home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / Technical Docs / Inside Macintosh / New Inside Mac - draft / Devices / Devices
Encoding:
Text File  |  1992-01-14  |  1.3 MB  |  4,407 lines  |  [ONLN/HLX2]

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1. Inside Macintosh:
  2. Devices
  3.     Apple Computer, Inc. 
  4. © 1991, Apple Computer, Inc.
  5. All rights reserved.
  6. Printed in the United States of 
  7. America.
  8. The Apple logo is a registered trademark of Apple Computer, Inc. Use of the “keyboard” 
  9. Apple logo (Option-Shift-K) for commercial purposes without the prior written consent of 
  10. Apple may constitute trademark infringement and unfair compe-tition in violation of federal and state laws.
  11. Apple Computer, Inc. 
  12. 20525 Mariani Avenue  
  13. Cupertino, CA  95014-6299
  14. 408-996-1010  
  15. Apple, the Apple logo, APDA, AppleLink, AppleShare, 
  16. AppleTalk, Apple IIGS, A/UX, EtherTalk, HyperCard, Hyper-Talk, ImageWriter, LaserWriter, LocalTalk, Mac, Macintosh, MPW, MultiFinder, SANE, and TokenTalk are registered trade-marks of Apple Computer, Inc.
  17. Apple Desktop Bus, Balloon Help, Finder, KanjiTalk, Moof, QuickDraw, ResEdit, TrueType, and Zhong-Wen Talk are trade-marks of Apple Computer, Inc.
  18. Helvetica and Times are 
  19. registered trademarks of 
  20. Linotype Company.
  21. ITC Zapf Dingbats is a registered trademark of International Typeface Corporation.
  22. MacPaint is a registered trade-mark of Claris Corporation.
  23. NuBus is a trademark of Texas 
  24. Instruments.
  25. PostScript is a registered trade-mark, and Illustrator is a 
  26. trademark, of Adobe Systems 
  27. Incorporated.
  28. Sony is a registered trademark of Sony Corporation.
  29. UNIX is a registered trademark of UNIX System Laboratories, Inc.
  30. Simultaneously published in the United States and Canada.
  31. Limited Warranty on Media and Replacement
  32. Even though Apple has 
  33. reviewed this manual, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS MANUAL, ITS QUALITY, ACCURACY, MERCHANT-ABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS 
  34. MANUAL IS SOLD “AS 
  35. IS,” AND YOU, THE PUR-CHASER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND 
  36. ACCURACY.  
  37. IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, 
  38. INDIRECT, SPECIAL, 
  39. INCIDENTAL, OR CONSE-QUENTIAL DAMAGES 
  40. RESULTING FROM ANY 
  41. DEFECT OR INACCURACY IN THIS MANUAL, even if advised of the possibility of such damages.  
  42. THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL 
  43. OTHERS, ORAL OR 
  44. WRITTEN, EXPRESS OR 
  45. IMPLIED. No Apple dealer, agent, or employee is 
  46. authorized to make any 
  47. modification, extension, or 
  48. addition to this warranty.  
  49. Some states do not allow the exclusion or limitation of 
  50. implied warranties or liability for incidental or consequential damages, so the above 
  51. limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state.
  52. The Device Manager
  53. Introduction to Devices and Drivers1-3
  54. About the Device Manager1-4
  55. Using the Device Manager1-7
  56. Opening and Closing Device Drivers1-8
  57. Communicating With Device Drivers1-10
  58. Controlling and Monitoring Device Drivers1-13
  59. Reference to the Device Manager1-15
  60. Data Structures1-15
  61. Routines1-18
  62. Opening and Closing Device Drivers1-18
  63. Reading From and Writing To Devices1-25
  64. Controlling and Monitoring Devices1-31
  65. Summary of the Device Manager1-39
  66. 1The Device Manager
  67. This chapter describes how your application can use the Device Manager to transfer information into and out of the Macintosh. The Device Manager controls the exchange of information between applications and hardware devices. Often applications communicate with the Device Manager indirectly, by calling routines of other managers (for example, the File Manager) which use the Device Manager. However, sometimes applications must call Device Manager routines directly.
  68. Read the information in this chapter if your application needs to use the Device Manager to communicate with a device. For example, you might need to use the Device Manager to communicate with a modem device on an expansion card. You would probably not need to use the Device Manager to communicate with a graphics device on an expansion card, as you would use QuickDraw instead. You also do not need to use the Device Manager directly to communicate with disk drives or printers, as you can use the File Manager or the Printing Manager.
  69. To use this chapter, you should be familiar with resources and how the system searches resource files. See the chapter “The Resource Manager” in the Inside Macintosh: Macintosh Toolbox volume.
  70. This chapter includes
  71. n    a brief introduction to devices and device drivers (the programs that control devices)
  72. n    a description of the Device Manager and how it manages device drivers 
  73. n    a discussion of how to use Device Manager routines to exchange information with devices and device drivers
  74. You can find specific information about the standard Macintosh device drivers, like the Disk Driver and the Serial Drivers, in separate chapters of this book. If you want to create your own device driver or desk accessory, you should first read this chapter and then read the chapter “Writing Your Own Device Driver” in this book.
  75. Introduction to Devices and Drivers
  76. A device is a physical part of the Macintosh, or a piece of external equipment, that can exchange information with applications or with the Operating System. Input devices transfer information into the Macintosh, while output devices receive information from the Macintosh. An I/O device can transfer information in either direction.
  77. Devices transfer information in one of two ways. Character devices read or write a stream of characters, or bytes, one at a time; they can neither skip bytes nor go back to previous bytes. The serial ports and printers are character devices.
  78. Block devices read and write entire blocks of bytes at one time; they can read or write any accessible block on demand. These devices are usually used to store and retrieve information. Disk drives are block devices.
  79. Devices communicate with applications and with the Operating System through special programs called device drivers. These drivers act as translators, converting software requests into hardware actions and hardware actions into software results. A synchronous device driver completes each communication request before returning control to the system. An asynchronous device driver can initiate a data transfer and return control to the system before the entire transfer is complete. This type of device driver usually relies on interrupts from its hardware device to regain control of the processor and continue or complete the data transfer.
  80. A device driver does not have to be associated with a device. In general, a device driver is a program that conforms to a predefined format and programming interface. Many device drivers take advantage of this predefined interface to perform tasks unrelated to actual physical devices. Desk accessories are an example of this kind of device driver.
  81. Some device drivers are stored in the Macintosh ROM; others are stored in driver ('DRVR') resources, which are typically located in applications, system extension files, and the firmware of expansion cards. A driver resource contains information about the driver, including the driver name, and the code necessary for the driver to perform its functions. The Device Manager must load a driver from its driver resource into memory before your application or any part of the system can communicate with it.
  82. The Device Manager opens certain device drivers at system startup time. These drivers make up the standard device drivers, which include the Disk Driver, the Serial Drivers, and printer drivers. The Device Manager opens other drivers when requested—typically by initialization ('INIT') resources, applications, and other drivers.
  83. About the Device Manager
  84. The Device Manager provides three basic services:
  85. n    It provides a common programming interface for applications and other managers to use when communicating with device drivers.
  86. n    It maintains data structures to manage open device drivers.
  87. n    It provides support routines useful when writing your own device drivers.
  88. Typically, your application won’t communicate directly with device drivers; instead, it will call Device Manager routines or call the routines of another manager that calls the Device Manager. For example, your application can communicate with a disk driver by calling the Device Manager directly or by calling the File Manager, which calls the Device Manager.
  89. Figure 1-1 shows the relationship between applications, the Device Manager, other managers, device drivers, and devices.
  90. Communication with Devices
  91. Before the Device Manager allows an application or another manager to communicate with a device driver, the driver must be open, which means the Device Manager has received a request to open the driver, has loaded the driver into memory if necessary, and has successfully called the driver’s opening routine.
  92. When opening a device driver, the Device Manager creates a device control entry (DCE), which contains information about the device driver. For example, the device control entry contains a handle to the device driver code (or a pointer for device drivers in ROM). Typically, the Device Manager maintains one device control entry for each open device driver, but it is possible for multiple entries to refer to the same driver.
  93. The Device Manager maintains another data structure, the unit table, to organize the device control entries. The unit table contains a handle to the device control entry for each open driver. The location of a driver’s device control entry in the unit table is called the driver’s unit number. 
  94. When you open a device driver, the Device Manager returns a driver reference number for the driver. You use the driver reference number, instead of the driver name, to identify the driver in subsequent communication requests. The driver reference number is related to the unit number by the following formula:
  95. The Device Manager also maintains a driver request queue for each open device driver. At the head of this queue is the I/O request currently being processed by the device driver. The rest of the queue contains pending I/O requests—requests the Device Manager has received but not yet sent to the device driver. This queue allows your application to request a data transfer with a busy device and accomplish other tasks while the device satisfies previous requests.
  96. With respect to the driver request queue, the Device Manager allows you make to three types of requests: synchronous, asynchronous, and immediate.
  97. The terms synchronous and asynchronous have different meanings depending on their context. 
  98. When referring to a device driver, the term synchronous indicates that the driver completes the entire request before returning control to the Device Manager. The term asynchronous indicates that the driver can begin processing a request and return control to the Device Manager before the request is complete. When a driver is handling a request asynchronously, it usually relies on interrupts from the hardware device to continue processing the request.
  99. When referring to requests, the terms synchronous and asynchronous indicate how the Device Manager processes the request. Actually, you can specify that the Device Manager process the request in one of three ways.
  100. n    Synchronous requests. When you make a synchronous request, the Device Manager places your request at the end of the driver request queue. The Device Manager then waits until the driver has handled every request in the queue, including the synchronous one, before returning control to your application. Notice there can never be more than one synchronous request per driver request queue at any given time. (The driver can handle each request in the queue synchronously or asynchronously, but the Device Manager does not return control to your application until the final request is complete.)
  101. n    Asynchronous requests. When you make an asynchronous request, the Device Manager places your request at the end of the driver request queue, but it returns control to your application immediately—potentially before the request is satisfied. Your application is free to perform other tasks while the driver satisfies the requests in its queue. The Device Manager provides mechanisms for your application to determine when the driver has satisfied the request. 
  102. n    Immediate requests. When you call a Device Manager routine immediately, the Device Manager sends your request directly to the driver, bypassing the driver request queue, and returns control to your application when the request is complete. An asynchronous device driver, which can process a single communication request in a number of steps, might be in the middle of processing another request. A similar situation can exist even for a synchronous device driver if you make the immediate request during interrupt time. Device drivers that can handle this situation correctly are called reentrant drivers. As some device drivers are not reentrant, you should always check a driver’s documentation before making immediate requests.
  103. The next section, “Using the Device Manager,” describes how to specify the manner in which the Device Manager should process your request.
  104. The chapter “Writing Your Own Device Driver” in this book gives more information about the Device Manager data structures and also describes the Device Manager routines useful for writing device drivers.
  105. Using the Device Manager
  106. Your application can use Device Manager routines to communicate with devices. It can use these routines to open and close device drivers, to exchange information with them, and to otherwise control and monitor them.
  107. The Device Manager includes high-level and low-level versions of most of its routines. The high-level versions are somewhat easier to use, but they allow less control of how the Device Manager executes the routine (for example, they always execute synchronously) and they return less information to your application. Conversely, the low-level routines require some additional setup, but they allow you greater control and return more information.
  108. The high-level routines differ in form, but the low-level routines all have the form:
  109. FUNCTION PBRoutineName                                         (paramBlock: ParmBlkPtr; 
  110.                                             async: Boolean): OSErr;
  111. The first parameter paramBlock is a Device Manager parameter block. You can use fields of this data structure to pass more complete information to the driver than you can with high-level routines, and the driver uses the same data structure to pass information back. The section “Data Structures,” on page 1-14, discusses the fields of the parameter block in detail.
  112. The second parameter async specifies whether the Device Manager should execute the routine asynchronously. If you set this parameter to FALSE, the Device Manager adds the parameter block to the driver request queue and waits until the driver completes the request (which means it has completed all previously queued requests) before returning control to your application. 
  113. If you set the async parameter to TRUE, the Device Manager adds the parameter block to the driver request queue and returns control to your application immediately. In this case, a noErr result code signifies that the request was successfully queued, not that the request was successfully completed. Your application can determine when the driver has completed the request by periodically polling the ioResult field of the parameter block. The Device Manager sets this field to 1 when the request is queued, and the driver stores the actual result code there when it completes the request.
  114. You can also provide a pointer to a completion routine in the ioCompletion field of the parameter block. The Device Manager executes this routine when the driver completes the asynchronous request. 
  115. ASSEMBLY-LANGUAGE NOTE
  116. You can call a Device Manager routine asynchronously, bypassing the request queue, by setting the immediate bit (bit 9) of the trap word. However, remember that the driver might have an asynchronous request pending. In fact, if you make an immediate request during interrupt time, the driver might be currently executing another request. Be sure the driver is reentrant—that is, that it can handle these situations.<36pt\>\x12 <8bat\>u
  117. Opening and Closing Device Drivers
  118. You must open a driver before your application can communicate with it. The Device Manager provides three functions for opening device drivers: OpenDriver, PBOpen, and OpenSlot. Each of these functions requires a driver name and returns a driver reference number.
  119. A driver name consists of a period (.) followed by any sequence of 1 to 254 printing characters; for example, .ATP is the name of one of the high-level AppleTalk drivers.
  120. The initial period in a driver name allows the Device Manager and the File Manager, which both use the PBOpen function, to distinguish between device driver names and file names. For the same reason, filenames should not start with a period.<36pt\>\x12 <8bat\>u
  121. The Device Manager assigns each open device driver a driver reference number. This number allows the Device Manager to locate the driver’s device control entry in the unit table.
  122. The OpenDriver function, which is the high-level opening routine, takes the driver name as its first parameter and returns the driver reference number in its second parameter.
  123. Listing 1-1 shows how to use the OpenDriver function to open a driver from a resource file.
  124. Opening a device driver from a resource file
  125. VAR     gDrvrRefNum            : Integer;
  126. PROCEDURE MyOpenDriver;
  127.                 VAR
  128.                     drvrHdl        : Handle;
  129.                     drvrID        : Integer;
  130.                     tempDrvrID    : Integer;
  131.                     drvrType    : ResType;
  132.                     drvrName    : Str255;
  133.                     err            : OSErr;
  134.         
  135.                 BEGIN
  136.                     tempDrvrID := FindEmptySpaceInUnitTable;
  137.     
  138.                     drvrHdl := GetNamedResource('DRVR','.DRIVER');
  139.                     GetResInfo(drvrHdl, drvrID, drvrType, drvrName);
  140.                     SetResInfo(drvrHdl, tempDrvrID, drvrName);
  141.     
  142.                     err := OpenDriver('.DRIVER',gDrvrRefNum);
  143.     
  144.                     IF (err = NoErr) THEN
  145.                         DetachResource(drvrHdl);
  146.         
  147.                     drvrHdl := GetNamedResource('DRVR',drvrName);
  148.                     SetResInfo(drvrHdl,drvrID, drvrName);
  149.                 END;
  150. The OpenDriver function uses the resource ID of the driver resource to determine where in the unit table to store the device control entry for the driver. Unfortunately, the OpenDriver function does not check to see if another device control entry is already located in that position in the unit table.
  151. Therefore, the MyOpenDriver procedure begins by finding an empty space in the unit table and then changes the resource ID of the driver resource before calling the OpenDriver function. (The chapter “Writing Your Own Device Driver” gives a complete definition of the FindEmptySpaceInUnitTable function.)
  152. After the driver is open, the MyOpenDriver procedure detaches the resource and restores the original resource ID.
  153. The PBOpen and OpenSlot functions, which are low-level functions, use the Device Manager parameter block, which is described fully in “Data Structures” on page 1-14. Both of these functions expect a pointer to the driver name in the ioNamePtr field of the parameter block and return the reference number in the ioRefNum field. 
  154. You use the PBOpen and OpenSlot functions in preference to the OpenDriver function when you want more control over how the Device Manager opens the device driver. For example, you can set read and write permissions for the device with the ioPermssn field of the parameter block.
  155. You use the OpenSlot function to open drivers that serve slot devices. This function uses an extended parameter block that includes extra fields specific to slot device drivers. You use the PBOpen function to open any other device drivers.
  156. You must open device drivers synchronously. If a device driver is already open, the driver-opening routines simply return the driver reference number.
  157. The remaining Device Manager routines require your application to use the reference number, instead of the driver name, when referring to a device.
  158. When you are done using a driver, you may want to close it. However, you should generally not close drivers that might be needed by the system or by other applications. Whether you should close a particular driver depends on the driver. You should check the documentation for the driver if you are not sure. Other chapters in Inside Macintosh give this information for the standard Macintosh drivers.
  159. If you do want to close a driver, you can use the high-level CloseDriver function or the low-level PBClose function. Listing 1-2 shows how to use the PBCLose function to close the driver opened in Listing 1-1.
  160. Closing a device driver
  161. PROCEDURE MyCloseDriver;
  162.                 VAR
  163.                     paramBlock    : ParamBlockRec;
  164.                     err            : OSErr;
  165.  
  166.                 BEGIN
  167.                     paramBlock.ioCompletion    := nil;
  168.                     paramBlock.ioRefNum        := gDrvrRefNum;
  169.     
  170.                     err := PBClose (@paramBlock, FALSE);
  171.                 END;
  172. The MyCloseDriver procedure specifies the driver to close by providing the driver reference number in the ioRefNum field of the parameter block and indicates that the Device Manager should not execute a completion routine by specifying NIL in the ioCompletion field of the parameter block. 
  173. Communicating With Device Drivers
  174. Once a driver is open and you have its reference number, you can use Device Manager communication routines to exchange information with it.
  175. When you want to send information to a device driver, you first store the information in a data buffer and then call the FSWrite function or the PBWrite function. When you want to receive information from a device driver, you first allocate a data buffer to hold the information, and then call the FSRead or PBRead function. You must specify the number of bytes you want transferred when calling any of these functions.
  176. Like all low-level routines, the PBWrite and PBRead functions allow you to transfer the information asynchronously, and with these functions you can provide a completion routine. These functions also allow you to specify a drive number, a positioning mode, and a positioning offset in the ioVRefNum, ioPosMode, and ioPosOffset fields of the parameter block. The Device Manager uses the positioning mode and positioning offset to determine where on a block device the transfer will occur. The Device Manager simply passes the drive number onto the driver. Be sure you specify these values in a manner compatible with the particular driver.
  177. The Device Manager defines three positioning modes for block devices:
  178. n    At the current position. With this mode, the transfer begins at the current position on the medium—typically where the last transfer ended.
  179. n    Offset from the start. This mode allows you to provide a positioning offset, which specifies at how many bytes from the beginning of the medium the transfer will begin.
  180. n    Offset from the mark. With this mode you can provide a positioning offset that specifies at how many bytes from the current position the transfer will begin. 
  181. On completion, the PBRead and PBWrite functions return the total number of bytes actually transferred in the ioActCount field of the parameter block. For block devices, these functions also return a new positioning offset in the ioPosOffset field.
  182. Certain device drivers provide additional abilities with the reading and writing functions. For example, the Disk Driver allows you to use the PBRead function to verify that data written to a block device matches the data in memory. To do this, you add the read-verify constant
  183. CONST rdVerify = 64;
  184. to the ioPosMode field of the parameter block, as explained in the description of the PBRead function in “Routines,” on page 1-25.
  185. Listing 1-3 shows an example that exchanges information with a device driver. 
  186. Communicating with a device driver
  187.             PROCEDURE MyReadFromDriver;
  188.                 VAR
  189.                     paramBlock    : ParamBlockRec;
  190.                     err            : OSErr;
  191.                     readBuf        : Str255;
  192.  
  193.                 BEGIN
  194.                     paramBlock.ioCompletion    := nil;
  195.                     paramBlock.ioRefNum        := gDrvrRefNum;
  196.                     paramBlock.ioBuffer        := @readBuf;
  197.                     paramBlock.ioReqCount    := 256;
  198.     
  199.                     err := PBRead (@paramBlock, FALSE);
  200.                 END;
  201.  
  202. PROCEDURE MyWriteToDriver;
  203.                 VAR
  204.                     paramBlock    : ParamBlockRec;
  205.                     err            : OSErr;
  206.                     buffer        : Str255;
  207.  
  208.                 BEGIN
  209.                     buffer := 'Data to Write';
  210.  
  211.                     paramBlock.ioCompletion    := nil;
  212.                     paramBlock.ioRefNum        := gDrvrRefNum;
  213.                     paramBlock.ioBuffer        := @buffer;
  214.                     paramBlock.ioReqCount    := 14;
  215.     
  216.                     err := PBWrite (@paramBlock, FALSE);
  217.                 END;
  218. The MyReadFromDriver procedure uses a parameter block to specify the device driver (by reference number), the number of bytes to read, a pointer to a buffer to receive the data, and NIL for the completion routine. It then sends the parameter block to the PBRead function. The Device Manager appends the parameter block to the end of the driver’s request queue. Since the parameter async is set to FALSE, the Device Manager does not return control to the MyReadFromDriver procedure until the driver has completed every request in its queue.
  219. The MyWriteToDriver procedure uses a parameter block to specify the device driver (by reference number), the size of the data to write, a pointer to the actual data, and NIL for the completion routine. It then sends the parameter block to the PBWrite function. The Device Manager appends the parameter block to the end of the driver’s request queue. Since the parameter async is set to FALSE, the Device Manager does not return control to the MyWriteToDriver procedure until the driver has completed every request in its queue.
  220. Controlling and Monitoring Device Drivers
  221. In addition to the reading and writing routines, the Device Manager provides routines that allow your application to control and monitor device drivers in other ways. 
  222. The Control and PBControl functions allow your application to send control information to a driver. The actual type of control information to which drivers respond varies greatly from driver to driver. For example, you can send control information to the standard Disk Driver requesting that it eject the disk.
  223. The Status and PBStatus functions allow your application to obtain status information from a driver. Again, the type of information drivers provide varies widely from driver to driver. As an example of status information, the Serial Driver provides a breakdown of the types of errors that have occurred recently.
  224. Like all low-level routines, you can call the PBControl and PBStatus functions asynchronously, and with these functions you can provide a completion routine. 
  225. Because of the diversity of device drivers, the controlling and monitoring functions have two general parameters: csCode and csParamPtr. The csCode parameter allows you to specify a driver-dependent code that indicates the type of control or status information. The csParamPtr parameter allows you to send or receive the actual control or status information.
  226. Notice that although the controlling and monitoring functions have a different interface than the reading and writing functions, their outcome is much the same: they exchange information with device drivers. Some device drivers (AppleTalk, for instance) implement all communication, even reading and writing, through the controlling and monitoring functions.
  227. The sample device driver described in the chapter “Writing Your Own Device Driver” accepts control and status requests. Listing 1-4 shows how to provide control information and determine status information for that device driver.
  228. Controlling and monitoring a device driver
  229.             PROCEDURE MyIssueDriverControl;
  230.                 VAR
  231.                     paramBlock    : ParamBlockRec;
  232.                     err            : OSErr;
  233.  
  234.                 BEGIN
  235.                     paramBlock.ioCompletion        := nil;
  236.                     paramBlock.ioCRefNum        := gDrvrRefNum;
  237.                     paramBlock.csCode            := 100;
  238.                     paramBlock.csParam[0]        := 3;        { beep 3 times }
  239.             
  240.                     err := PBControl (@paramBlock, FALSE);
  241.                 END;
  242.  
  243.             PROCEDURE MyGetDriverStatus;
  244.                 VAR
  245.                     paramBlock    : ParamBlockRec;
  246.                     err            : OSErr;
  247.                     beepTimes    : Integer;
  248.  
  249.                 BEGIN
  250.                     paramBlock.ioCompletion    := nil;
  251.                     paramBlock.ioCRefNum    := gDrvrRefNum;
  252.                     paramBlock.csCode        := 100;
  253.     
  254.                     err := PBStatus (@paramBlock, FALSE);
  255.     
  256.                     IF (err = noErr) THEN
  257.                         beepTimes := paramBlock.csParam[0];
  258.                 END;
  259. The MyIssueDriverControl procedure begins by setting up the fields of a parameter block. The ioCRefNum field specifies the device driver reference number and the ioCompletion field specifies NIL for the completion routine. The csCode field specifies the type of control information being sent. The sample device driver from the chapter “Writing Your Own Device Driver” interprets a value of 100 as a request for the device driver to produce a system beep. When the value of the csCode field is 100, the value of the csParam field signifies the number of times to beep.
  260. The MyGetDriverStatus procedure also begins by setting up the fields of a parameter block. The ioCRefNum field specifies the device driver reference number and the ioCompletion field specifies NIL for the completion routine. The csCode field specifies the type of status information being requested. For this particular device driver, the value 128 indicates the driver should return the number of times it last beeped. The PBStatus function causes the driver to store this information in the csParam field of the parameter block.
  261. Reference to the Device Manager
  262. This section describes the data structures and routines that allow you to use the Device Manager to communicate with device drivers. 
  263. The “Data Structures” section shows the Pascal definition for the Device Manager parameter block. The “Routines” section describes the routines you use to open and close device drivers, read from and write to device drivers, and control and monitor device drivers. Constants used by these routines are listed in the section “Summary of the Device Manager,” on page 1-37.
  264. The chapter “Writing Your Own Device Driver” in this book describes the Device Manager data structures and routines useful when writing a device driver.
  265. Data Structures
  266. The Device Manager provides both a high-level and a low-level interface for communicating with device drivers. You pass information to the low-level routines in a Device Manager parameter block. 
  267. The Device Manager uses two forms of the parameter block: one for the opening, closing, reading, and writing routines and another for controlling and monitoring routines. Other managers use different variants of this data structure.
  268. TYPE 
  269.     ParamBlkType = {ioParam, fileParam, volumeParam, cntrlParam};
  270.     ParamBlockRec = 
  271.         RECORD
  272.             qLink:                    QElemPtr;                {next queue entry}
  273.             qType:                    Integer;                {queue type}
  274.             ioTrap:                    Integer;                {routine trap                }
  275.             ioCmdAddr:                    Ptr;                {routine address                    }
  276.             ioCompletion:                    ProcPtr;                {completion routine}
  277.             ioResult:                    OSErr;                {result code}
  278.             ioNamePtr:                    StringPtr;                {driver name                }
  279.             ioVRefNum    :                Integer;                {volume reference or drive number}
  280.             CASE ParamBlkType OF
  281.                 ioParam:
  282.                   (ioRefNum:                 Integer;                    {driver reference number                                }
  283.                     ioVersNum:                 SignedByte;                    {not used            }
  284.                     ioPermssn:                 SignedByte;                    {read/write permission                            }
  285.                     ioMisc:                 Ptr;                    {not used}
  286.                     ioBuffer:                 Ptr;                    {pointer to data buffer}
  287.                     ioReqCount:                 LongInt;                    {requested number of bytes                                }
  288.                     ioActCount:                 LongInt;                    {actual number of bytes                            }
  289.                     ioPosMode:                 Integer;                    {positioning mode                    }
  290.                     ioPosOffset:                 LongInt);                    {positioning offset                        }
  291.                 cntrlParam:
  292.                   (ioCRefNum:                     Integer;                    {driver reference number                                }
  293.                     csCode:                 SignedByte;                    {type of request                    }
  294.                     csParam:                 ARRAY[1..10] OF Integer);                                
  295.                                                         {control or status info        }
  296.             END;
  297.         END;
  298. qLink    Used internally by the Device Manager. 
  299. qType    Used internally by the Device Manager.
  300. ioTrap    Used internally by the Device Manager.
  301. ioCmdAddr    Used internally by the Device Manager.
  302. ioCompletion    Specifies a pointer to a completion routine. When making asynchronous requests, you must set this field to NIL if you are not specifying a completion routine. The Device Manager automatically sets this field to NIL when you make a synchronous request.
  303. ioResult    Contains a value indicating whether the routine completed successfully. The Device Manager sets this field to 1 when it queues an asynchronous request. When the driver completes the request, it places the actual result code in this field. You can poll this field to detect when the driver has completed the request and to determine its result code. The Device Manager executes the completion routine after this field receives the result code.
  304. ioNamePtr    Points to the name of the driver. You use this field only when opening a driver.
  305. ioVRefNum    Contains the drive number, if any. The meaning of this field depends on the device driver. The Disk Driver uses this field to identify disk devices.
  306. I/O field descriptions
  307. ioRefNum    Specifies the driver reference number.
  308. ioVersNum    Not used.
  309. ioPermssn    Contains the read/write permission of the driver. When you open a driver, you must supply one of the following values in this field:
  310.         CONST fsCurPerm  = 0;  {retain current permission}
  311.       fsRdPerm   = 1;  {allow reads only}
  312.       fsWrPerm   = 2;  {allow writes only}
  313.       fsRdWrPerm = 3;  {allow reads and writes}
  314.     The Device Manager compares subsequent read and write requests with the read/write permission of the driver. If the request type is not permitted, the Device Manager returns a a result code indicating the error.
  315. ioMisc    Not used.
  316. ioBuffer    Points to the data buffer for the driver to use for reads or writes.
  317. ioReqCount    Specifies the requested number of bytes for the driver to read or write.
  318. ioActCount    Indicates the actual number of bytes the driver reads or writes.
  319. ioPosMode        Specifies the positioning mode used by drivers of block devices. Bits 0 and 1 of this field indicate where an operation should begin relative to the physical beginning of the block-formatted medium. You can use the following constants to test or set the value of these bits:
  320.         CONST fsAtMark    = 0; {at current position}
  321.       fsFromStart = 1; {offset from beginning}
  322.       fsFromMark  = 2; {offset from current pos.}
  323.     The Disk Driver allows you to add the following constant to this field to specify a read-verify operation:
  324.         CONST rdVerify   = 64; {read-verify mode}
  325.                                 See the description of the PBRead function in “Reading From and Writing To Devices,” on page 1-25.
  326. ioPosOffset    Specifies the byte offset, relative to the position specified by the positioning mode, where the driver should perform the operation. If you specify the fsAtMark positioning mode, the Device Manager ignores this field.
  327. Control and status field descriptions
  328. ioCRefNum    Contains the driver reference number.
  329. csCode    Contains a value identifying the type of the control or status request. Each driver may interpret this number differently.
  330. csParam    Contains the actual control or status information for the request; this field is declared generically as an array of ten integers because its actual format varies from one type of control or status request to the next.
  331. Routines
  332. This section describes the Device Manager routines you use to open and close device drivers, read from and write to device drivers, and control and monitor device drivers. 
  333. The low-level routines in this section accept a pointer to a parameter block as a parameter. For these routines, the routine description includes a list of the fields in the parameter block that are used by the routine.
  334. Opening and Closing Device Drivers
  335. A driver must be open before your application can communicate with it. You can use the OpenDriver or PBOpen function to open closed drivers or to determine the driver reference number of an already open device driver. You can use the OpenSlot function to open drivers that serve slot devices.
  336. When you have finished communicating with a driver, you can close it if you are sure no other application or part of the system needs to use it. You can use the CloseDriver or PBClose function to close a driver.
  337. The PBOpen and PBClose functions use the I/O fields of the parameter block. The OpenSlot function uses the I/O fields and some additional fields that apply only to slot devices.
  338. 1OpenDriver
  339. You can use the OpenDriver function to open a closed device driver or to determine the reference number of an open device driver.
  340. FUNCTION OpenDriver                                     (name: Str255;
  341.                                        VAR refNum: Integer): OSErr;
  342. name    Specifies the name of the driver to open. A driver name consists of a period (.) followed by any sequence of 1 to 254 printing characters. The Device Manager ignores case (but not diacritical marks) when comparing names.
  343. refNum    Contains the reference number of the driver. The OpenDriver function uses this parameter to return the reference number of the open driver.
  344. DESCRIPTION
  345. The OpenDriver function opens the device driver specified by the name parameter and returns its reference number in the refNum parameter. The Device Manager searches the drivers that are already installed in the unit table before searching driver resources to avoid replacing a current driver. If the specified driver is already open, this function simply returns the driver’s reference number. 
  346. If the specified driver is not already open, the Device Manager searches for a driver resource with the specified name. If the Device Manager finds such a resource, the resource ID determines the location in the unit table where the Device Manager installs the driver’s DCE. Since another driver might already be installed in the unit table at the location determined by the resource ID, you should first search for an unused location in the unit table and renumber the resource accordingly before calling this function. See Listing 1-1 on page 1-8 for an example.
  347. The OpenDriver function is a high-level version of the low-level PBOpen function. Use the PBOpen function when you need to specify read/write permission for the driver. See the description of the PBOpen function on page 1-18.
  348. SPECIAL CONSIDERATIONS
  349. The OpenDriver function may move memory; you should not call it at interrupt time.
  350. RESULT CODES
  351. noErr    0    No error
  352. badUnitErr    –21    Reference number out of range or not in use
  353. unitEmptyErr    –22    DCE points to null driver
  354. openErr    –23    Driver can’t perform requested open
  355. dInstErr    –26    Couldn’t find driver in resource file
  356. SEE ALSO
  357. For information about the low-level routines for opening devices, see the next section, which describes the PBOpen function, and the description of the OpenSlot function on page 1-20.
  358. For an example of opening a device driver, see Listing 1-1 on page 1-8.
  359. 1PBOpen
  360. You can use the PBOpen function to open a closed device driver or to determine the reference number of an open device driver.
  361. FUNCTION PBOpen                                 (paramBlock: ParmBlkPtr;
  362.                                   async: Boolean): OSErr;
  363. paramBlock    Contains a pointer to the parameter block.
  364. async    Specifies to the Device Manager whether the request is
  365.     asynchronous. You should always set this field to FALSE.
  366. You specify values and receive return values in a Device Manager parameter block.
  367. <symbol\>\xae     ioCompletion    ProcPtr    A pointer to completion routine.
  368. <symbol\>\xac     ioResult    OSErr    The result code of the function.
  369. <symbol\>\xae     ioNamePtr    StringPtr    
  370. A pointer to the driver name.
  371. <symbol\>\xac     ioRefNum    Integer    The driver reference number.
  372. <symbol\>\xae     ioPermssn    SignedByte
  373. Read/write permission.
  374. DESCRIPTION
  375. The PBOpen function opens the device driver specified by the ioNamePtr field, installing it if necessary, and returns its reference number in the ioRefNum field. The Device Manager searches the drivers that are already installed in the unit table before searching driver resources to avoid replacing a current driver. If the specified driver is already open, this function returns the driver reference number already belonging to the driver.
  376. If the specified driver is not already open, the Device Manager searches for a driver resource with the specified name. If the Device Manager finds such a resource, the resource ID determines the location in the unit table where the Device Manager installs the driver’s DCE. Since another driver might already be installed in the unit table at the location determined by the resource ID, you should first search for an unused location in the unit table and renumber the resource accordingly before calling this function. See Listing 1-1 on page 1-8 for an example.
  377. If the driver returns a negative result in register D0, the Device Manager returns the result code in the ioResult parameter and does not open the driver.
  378. SPECIAL CONSIDERATIONS
  379. The PBOpen function may move memory; you should not call it at interrupt time.
  380. ASSEMBLY-LANGUAGE INFORMATION
  381. The trap macro for the PBOpen function is _Open ($A000). You must setup register A0 with the address of the parameter block. When _Open returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  382. Registers on entry
  383. A0    address of the parameter block
  384. Registers on exit
  385. D0    result code
  386. RESULT CODES
  387. noErr    0    No error
  388. badUnitErr    –21    Reference number out of range or not in use
  389. unitEmptyErr    –22    DCE points to null driver
  390. openErr    –23    Driver can’t perform requested open
  391. dInstErr    –26    Couldn’t find driver in resource file
  392. SEE ALSO
  393. For information about the high-level routine for opening device drivers, see the previous section, which describes of the OpenDriver routine.
  394. For information about the low-level routine for opening device drivers that serve devices on expansion cards, see the next section, which describes of the OpenSlot routine.
  395. For an example of opening a device driver, see Listing 1-1 on page 1-8.
  396. 1OpenSlot
  397. You can use the OpenSlot function to open a device driver that serves a slot device.
  398. FUNCTION OpenSlot                                (paramBlock: ParmBlkPtr;
  399.                                    async: Boolean) : OSErr;
  400. paramBlock    Contains a pointer to the parameter block.
  401. async    Specifies to the Device Manager whether the request is
  402.     asynchronous. You should always set this field to FALSE.
  403. You specify values and receive return values in a Device Manager parameter block with a few additional fields that apply only to slot devices.
  404. <symbol\>\xae     ioCompletion    ProcPtr    Pointer to completion routine.
  405. <symbol\>\xac     ioResult    OSErr    Result code.
  406. <symbol\>\xae     ioNamePtr    StringPtr    
  407. Driver name.
  408. <symbol\>\xac     ioRefNum    Integer    Driver reference number.
  409. <symbol\>\xae     ioPermssn    SignedByte
  410. Read/write permission.
  411. Additional fields—single device
  412. <symbol\>\xae     ioMix    Ptr    Reserved for use by driver Open routine.
  413. <symbol\>\xae     ioFlags    Integer    Determines number of additional fields.
  414. <symbol\>\xae     ioSlot    SignedByte
  415. Slot number.
  416. <symbol\>\xae     ioId    SignedByte
  417. Slot resource ID.
  418. Additional fields—multiple devices
  419. <symbol\>\xae     ioMix    Ptr    Reserved for use by driver Open routine.
  420. <symbol\>\xae     ioFlags    Integer    Determines number of additional fields.
  421. <symbol\>\xae     ioSEBlkPtr    Ptr    Pointer to external parameter block.
  422. DESCRIPTION
  423. The OpenSlot function is equivalent to the PBOpen function, except that it sets the immediate bit (bit 9) of the trap word, which signals the _Open routine that the parameter block includes additional fields.
  424. If the slot resource, which is defined in the chapter “The Slot Manager” in this book, serves a single device, you should clear all the bits of the ioFlags field and include the slot number and slot resource ID in the ioSlot and ioID fields.
  425. If the slot resource serves multiple devices, you should set the fMulti bit of the ioFlags field (clearing all other bits to 0), and specify, in the ioSEBlkPtr field, an external parameter block that is customized for the devices installed in the slot. 
  426. See the chapter “The Slot Manager” in this book for more details.
  427. SPECIAL CONSIDERATIONS
  428. The OpenSlot function may move memory; you should not call it at interrupt time.
  429. ASSEMBLY-LANGUAGE INFORMATION
  430. The trap macro for the OpenSlot function is _Open ($A200). The immediate bit (bit 9) of the trap word is set to signal to that the parameter block contains the additional fields.
  431. You must setup register A0 with the address of the parameter block. When _Open returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  432. Registers on entry
  433. A0    address of the parameter block
  434. Registers on exit
  435. D0    result code
  436. RESULT CODES
  437. noErr    0    No error
  438. badUnitErr    –21    Reference number out of range or not in use
  439. unitEmptyErr    –22    DCE points to null driver
  440. openErr    –23    Driver can’t perform requested open
  441. dInstErr    –26    Couldn’t find driver in resource file
  442. SEE ALSO
  443. For information about the low-level routine for opening other device drivers, see the previous section, which describes the PBOpen routine.
  444. For an example of opening a device driver, see Listing 1-1 on page 1-8.
  445. 1CloseDriver
  446. You can use the CloseDriver function to close an open device driver.
  447. FUNCTION CloseDriver                                        (refNum: Integer) : OSErr;
  448. refNum    Contains the reference number of the driver returned by the driver-opening function.
  449. DESCRIPTION
  450. The CloseDriver function closes the device driver indicated by the refNum parameter. The Device Manager completes any pending I/O for this driver and releases the memory used by the driver.
  451. You should not close drivers that other applications may be using, such as the Disk Driver, the AppleTalk drivers, and so on.<36pt\>\x12 <8bat\>s
  452. The CloseDriver function is a high-level version of the low-level PBClose function. Use the PBClose function when you want to specify a completion routine. See the description of the PBClose function on page 1-22.
  453. SPECIAL CONSIDERATIONS
  454. The CloseDriver function does not move memory; you may call it at interrupt time.
  455. RESULT CODES
  456. noErr    0    No Error
  457. badUnitErr    –21    Reference number out of range or not in use
  458. unitEmptyErr    –22    DCE points to null driver
  459. notOpenErr    –26    Driver isn’t open
  460. abortErr    –27    Close request aborted by KillIO
  461. SEE ALSO
  462. For information about the low-level routine for closing device drivers, see the next section, which describes the PBClose function.
  463. 1PBClose
  464. You can use the PBClose function to close an open device driver.
  465. FUNCTION PBClose                                 (paramBlock: ParmBlkPtr;
  466.                                    async: Boolean): OSErr;
  467. paramBlock    Contains a pointer to the parameter block.
  468. async    Specifies to the Device Manager whether the request is asynchronous. 
  469. You specify values and receive return values in a Device Manager parameter block.
  470. <symbol\>\xae     ioCompletion    ProcPtr    Pointer to completion routine.
  471. <symbol\>\xac     ioResult    OSErr    Result code.
  472. <symbol\>\xae     ioRefNum    Integer    Driver reference number.
  473. DESCRIPTION
  474. The PBClose function closes the device driver specified by the ioRefNum field. The Device Manager completes any pending I/O for this driver and releases the memory used by the driver.
  475. You should not close drivers that other applications may be using, such as the Disk Driver, the AppleTalk drivers, and so on.<36pt\>\x12 <8bat\>s
  476. If the driver returns a negative result in register D0, the Device Manager returns this result code in the ioResult parameter and does not close the driver.
  477. SPECIAL CONSIDERATIONS
  478. The PBClose function does not move memory; you may call it at interrupt time.
  479. ASSEMBLY-LANGUAGE INFORMATION
  480. The trap macro for the PBClose function is _Close ($A001). Set bit 10 of the trap word to execute this routine asynchronously. Set bit 9 to execute it immediately.
  481. You must setup register A0 with the address of the parameter block. When _Close returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  482. Registers on entry
  483. A0    address of the parameter block
  484. Registers on exit
  485. D0    result code
  486. RESULT CODES
  487. noErr    0    No Error
  488. badUnitErr    –21    Reference number out of range or not in use
  489. unitEmptyErr    –22    DCE points to null driver
  490. notOpenErr    –26    Driver isn’t open
  491. abortErr    –27    Close request aborted by KillIO
  492. SEE ALSO
  493. For information about the high-level routine for closing device drivers, see the previous section, which describes the CloseDriver function.
  494. Reading From and Writing To Devices
  495. You can use either the FSRead or PBRead function to read information from a device driver and you can use the FSWrite or PBWrite function to write information to a device driver.
  496. The PBRead and PBWrite functions use the additional I/O fields of the parameter block, as described on page 1-15.
  497. 1FSRead
  498. You can use the FSRead function to read data from an open driver into a data buffer.
  499. FUNCTION FSRead                                 (refNum: Integer; VAR count: LongInt;
  500.                                   buffPtr: Ptr): OSErr;
  501. refNum    Specifies the reference number of the driver.
  502. count    Indicates the number of bytes to read.
  503. buffPtr    Points to a data buffer to hold the data.
  504. DESCRIPTION
  505. Before calling the FSRead function, your application should allocate a data buffer large enough to hold the data to be read. The FSRead function attempts to read the number of bytes indicated by the count parameter from the specified device driver, and transfer them to this data buffer. After the transfer is complete, the count parameter indicates the number of bytes actually read. 
  506. Be sure your buffer is large enough to hold the number of bytes specified by the count parameter, or this function may corrupt memory. <36pt\>\x12 <8bat\>s
  507. The FSRead function is a high-level version of the low-level PBRead function. Use the PBRead function when you want to request asynchronous reading or need to specify a drive number or a positioning mode and offset. See the next section, which describes the PBRead function.
  508. SPECIAL CONSIDERATIONS
  509. The FSRead function does not move memory. However, you should be sure the device driver does not move memory in response to a read request before you call this function at interrupt time.
  510. RESULT CODES
  511. noErr    0    No Error
  512. readErr    –19    Driver can’t respond to read requests
  513. badUnitErr    –21    Reference number out of range or not in use
  514. unitEmptyErr    –22    DCE points to null driver
  515. notOpenErr    –26    Driver isn’t open
  516. abortErr    –27    Read aborted by KillIO
  517. SEE ALSO
  518. For information about the low-level routine for reading from device drivers, see the next section, which describes the PBRead function.
  519. 1PBRead
  520. You can use the PBRead function to read data from an open driver into a data buffer.
  521. FUNCTION PBRead                                 (paramBlock: ParmBlkPtr; async: Boolean) : OSErr;
  522. paramBlock    Contains a pointer to the parameter block.
  523. async    Specifies to the Device Manager whether the request is asynchronous. 
  524. You specify values and receive return values in a Device Manager parameter block.
  525. <symbol\>\xae     ioCompletion    ProcPtr    Pointer to completion routine.
  526. <symbol\>\xac     ioResult    OSErr    Result code.
  527. <symbol\>\xae     ioVRefNum    Integer    Drive number.
  528. <symbol\>\xae     ioRefNum    Integer    Driver reference number.
  529. <symbol\>\xae     ioBuffer    Ptr    Pointer to data buffer.
  530. <symbol\>\xae     ioReqCount    LongInt    Requested number of bytes to read.
  531. <symbol\>\xac     ioActCount    LongInt    Actual number of bytes read.
  532. <symbol\>\xae     ioPosMode    Integer    Positioning mode.
  533. <symbol\>\xab     ioPosOffset    LongInt    Positioning offset.
  534. DESCRIPTION
  535. Before calling the PBRead function, your application should allocate a data buffer large enough to hold the data to be read. The PBRead function attempts to read the number of bytes indicated by the ioReqCount field from the specified device driver and transfer them to this data buffer. After the transfer is complete, the ioActCount field indicates the number of bytes actually read.
  536. Be sure your buffer is large enough to hold the number of bytes specified by the count parameter, or this function may corrupt memory. <36pt\>\x12 <8bat\>s
  537. For block devices such as disk drivers, the PBRead function allows you to specify a drive number in the ioVRefNum field and specify a positioning mode and offset in the ioPosMode and ioPosOffset fields. Bits 0 and 1 of the ioPosMode field indicate where an operation should begin relative to the physical beginning of the block-formatted medium. You can use the following constants to test or set the value of these bits:
  538.         CONST fsAtMark   = 0;     {at current position}
  539.       fsFromStart= 1;     {offset from beginning}
  540.       fsFromMark = 2;     {offset from current position}
  541. After the transfer is complete, the ioPosOffset field indicates the current position of the block device.
  542. The Disk Driver allows you to use the PBRead function to verify that data written to a block device matches the data in memory. To do this, call PBRead immediately after writing the data, and add the read-verify constant
  543. CONST rdVerify = 64; {read-verify mode}
  544. to the ioPosMode field of the parameter block.
  545. SPECIAL CONSIDERATIONS
  546. The PBRead function does not move memory. However, you should be sure the device driver does not move memory in response to a read request before you call this function at interrupt time.
  547. ASSEMBLY-LANGUAGE INFORMATION
  548. The trap macro for the PBRead function is _Read ($A002). Set bit 10 of the trap word to execute this routine asynchronously. Set bit 9 to execute it immediately.
  549. You must setup register A0 with the address of the parameter block. When _Read returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  550. Registers on entry
  551. A0    address of the parameter block
  552. Registers on exit
  553. D0    result code
  554. RESULT CODES
  555. noErr    0    No error
  556. readErr    –19    Driver can’t respond to read requests
  557. badUnitErr    –21    Reference number out of range or not in use
  558. unitEmptyErr    –22    DCE points to null driver
  559. notOpenErr    –26    Driver isn’t open
  560. abortErr    –27    Read aborted by KillIO
  561. ioErr    –36    Data doesn’t match in read-verify mode
  562. SEE ALSO
  563. For information about the high-level routine for reading from device drivers, see the previous section, which describes the FSRead function. 
  564. 1FSWrite
  565. You can use the FSWrite function to write data from a data buffer to an open driver.
  566. FUNCTION FSWrite                                 (refNum: Integer; VAR count: LongInt;
  567.                                    buffPtr: Ptr) : OSErr;
  568. refNum    Specifies the reference number of the driver.
  569. count    Indicates the number of bytes to write.
  570. buffPtr    Points to the data buffer that holds the data.
  571. DESCRIPTION
  572. The FSWrite function attempts to write the number of bytes indicated by the count parameter from the data buffer pointed to by the buffPtr parameter to the specified device driver. After the transfer is complete, the count parameter indicates the number of bytes actually written.
  573. The FSWrite function is a high-level version of the low-level PBWrite function. Use the PBWrite function when you want to request asynchronous writing or need to specify a drive number or a positioning mode and offset. See the next section, which describes the PBWrite function, for further information.
  574. SPECIAL CONSIDERATIONS
  575. The FSWrite function does not move memory. However, you should be sure the device driver does not move memory in response to a write request before you call this function at interrupt time.
  576. RESULT CODES
  577. noErr    0    No error
  578. writErr    –20    Driver can’t respond to write requests
  579. badUnitErr    –21    Reference number out of range or not in use
  580. unitEmptyErr    –22    DCE points to null driver
  581. notOpenErr    –26    Driver isn’t open
  582. abortErr    –27    Write aborted by KillIO
  583. SEE ALSO
  584. For information about the low-level routine for writing to device drivers, see the next section, which describes the PBWrite function.
  585. 1PBWrite
  586. You can use the PBWrite function to write data from a data buffer to an open driver.
  587. FUNCTION PBWrite                                 (paramBlock: ParmBlkPtr;
  588.                                    async: Boolean): OSErr;
  589. paramBlock    Contains a pointer to the parameter block.
  590. async    Specifies to the Device Manager whether the request is asynchronous. 
  591. You specify values and receive return values in a Device Manager parameter block.
  592. <symbol\>\xae     ioCompletion    ProcPtr    Pointer to completion routine.
  593. <symbol\>\xac     ioResult    OSErr    Result code.
  594. <symbol\>\xae     ioVRefNum    Integer    Drive number.
  595. <symbol\>\xae     ioRefNum    Integer    Driver reference number.
  596. <symbol\>\xae     ioBuffer    Ptr    Pointer to data buffer.
  597. <symbol\>\xae     ioReqCount    LongInt    Requested number of bytes to write.
  598. <symbol\>\xac     ioActCount    LongInt    Actual number of bytes written.
  599. <symbol\>\xae     ioPosMode    Integer    Positioning mode.
  600. <symbol\>\xab     ioPosOffset    LongInt    Positioning offset.
  601. DESCRIPTION
  602. The PBWrite function attempts to write the number of bytes indicated by the ioReqCount field from the data buffer pointed to by the ioBuffer field to the driver specified by the ioRefNum field. After the transfer is complete, the ioActCount field indicates the number of bytes actually written.
  603. For block devices such as disk drivers, the PBWrite function allows you to specify a drive number in the ioVRefNum field and specify a positioning mode and offset in the ioPosMode and ioPosOffset fields. Bits 0 and 1 of the ioPosOffset field indicate where an operation should begin relative to the physical beginning of the block-formatted medium. You can use the following constants to test or set the value of these bits:
  604.         CONST fsAtMark   = 0;     {at current position}
  605.       fsFromStart= 1;     {offset from beginning}
  606.       fsFromMark = 2;     {offset from current position}
  607. After the transfer is complete, the ioPosOffset field indicates the new current position of a block device.
  608. SPECIAL CONSIDERATIONS
  609. The PBWrite function does not move memory. However, you should be sure the device driver does not move memory in response to a write request before you call this function at interrupt time.
  610. ASSEMBLY-LANGUAGE INFORMATION
  611. The trap macro for the PBWrite function is _Write ($A003). Set bit 10 of the trap word to execute this routine asynchronously. Set bit 9 to execute it immediately.
  612. You must setup register A0 with the address of the parameter block. When _Write returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  613. Registers on entry
  614. A0    address of the parameter block
  615. Registers on exit
  616. D0    result code
  617. RESULT CODES
  618. noErr    0    No error
  619. writErr    –20    Driver can’t respond to read requests
  620. badUnitErr    –21    Reference number out of range or not in use
  621. unitEmptyErr    –22    DCE points to null driver
  622. notOpenErr    –26    Driver isn’t open
  623. abortErr    –27    Write aborted by KillIO
  624. SEE ALSO
  625. For information about the high-level routine for writing to device drivers, see the previous section, which describes the FSWrite function.
  626. Controlling and Monitoring Devices
  627. You can use either the Control or PBControl function to send control information to a device driver, and you can use the Status or PBStatus function to obtain status information to a device driver. The Device Manager provides the KillIO and PBKillIO functions for terminating all requests in a driver’s request queue.
  628. The PBControl, PBStatus, and PBKillIO functions use the additional control and status fields of the parameter block, as described on page 1-16.
  629. 1Control
  630. You can use the Control function to send control information to a device driver.
  631. FUNCTION Control                                 (refNum: Integer; csCode: Integer;
  632.                                     csParamPtr: Ptr): OSErr;
  633. refNum    Contains the reference number identifying the driver.
  634. csCode    Contains a driver-dependent code specifying the type of information sent.
  635. csParamPtr        Contains a pointer to the actual control information.
  636. DESCRIPTION
  637. The Control function sends information to the device driver specified by the reference number in the refNum parameter. The value you pass in the csCode parameter and the type of information pointed to by the csParamPtr parameter depend on the driver being called. For more information, see the specific chapters for the standard drivers.
  638. The Control function is a high-level version of the low-level PBControl function. Use the PBControl function, described in the next section, if you need to specify a drive number or if you want the control request to be asynchronous.
  639. SPECIAL CONSIDERATIONS
  640. The Control function does not move memory. However, you should be sure the device driver does not move memory in response to a control request before you call this function at interrupt time.
  641. RESULT CODES
  642. noErr    0    No error
  643. controlErr    –17    Driver can’t respond to this control request
  644. badUnitErr    –21    Reference number out of range or not in use
  645. unitEmptyErr    –22    DCE points to null driver
  646. notOpenErr    –26    Driver isn’t open
  647. abortErr    –27    Control request aborted by KillIO
  648. SEE ALSO
  649. For information about the low-level routine for controlling device drivers, see the next section, which describes the PBControl function.
  650. 1PBControl
  651. You can use the PBControl function to send control information to a device driver.
  652. FUNCTION PBControl                                 (paramBlock: ParmBlkPtr;
  653.                                        async: Boolean): OSErr;
  654. paramBlock    Contains a pointer to the parameter block.
  655. async    Specifies to the Device Manager whether the request is asynchronous. 
  656. You specify values and receive return values in a Device Manager parameter block.
  657. <symbol\>\xae     ioCompletion    ProcPtr    Pointer to completion routine.
  658. <symbol\>\xac     ioResult    OSErr    Result code.
  659. <symbol\>\xae     ioVRefNum    Integer    Drive number.
  660. <symbol\>\xae     ioCRefNum    Integer    Driver reference number.
  661. <symbol\>\xae     csCode    Ptr    Type of control call.
  662. <symbol\>\xae     csParam    ARRAY[1..10] OF Integer    
  663.                     Control information.
  664. DESCRIPTION
  665. The PBControl function sends information to the device driver specified by the ioCRefNum field. The value you pass in the csCode field and the type of information in the csParamPtr parameter depend on the driver being called. For more information, see the specific chapters for the standard drivers.
  666. SPECIAL CONSIDERATIONS
  667. The PBControl function does not move memory. However, you should be sure the device driver does not move memory in response to a control request before you call this function at interrupt time.
  668. ASSEMBLY-LANGUAGE INFORMATION
  669. The trap macro for the PBControl function is _Control ($A004). Set bit 10 of the trap word to execute this routine asynchronously. Set bit 9 to execute it immediately.
  670. You must setup register A0 with the address of the parameter block. When _Control returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  671. Registers on entry
  672. A0    address of the parameter block
  673. Registers on exit
  674. D0    result code
  675. RESULT CODES
  676. noErr    0    No error
  677. controlErr    –17    Driver can’t respond to this control request
  678. badUnitErr    –21    Reference number out of range or not in use
  679. unitEmptyErr    –22    DCE points to null driver
  680. notOpenErr    –26    Driver isn’t open
  681. abortErr    –27    Control request aborted by KillIO
  682. SEE ALSO
  683. For information about the high-level routine for controlling device drivers, see the previous section, which describes the Control function.
  684. 1Status
  685. You can use the Status function to obtain status information from a device driver.
  686. FUNCTION Status                                    (refNum: Integer; csCode: Integer;
  687.                                      csParamPtr: Ptr): OSErr;
  688. refNum    Contains the reference number identifying the driver.
  689. csCode    Contains a driver-dependent code specifying the type of information requested.
  690. csParamPtr        Contains a pointer to the status information received.
  691. DESCRIPTION
  692. The Status function returns information about the device driver having the reference number specified by the refNum parameter. The value you pass in the csCode parameter, and the received information pointed to by the csParamPtr parameter depend on the driver being called. For more information, see the specific chapters for the standard drivers.
  693. The Status function is a high-level version of the low-level PBStatus function. Use the PBStatus function if you need to specify a drive number or if you want the status request to be asynchronous.
  694. SPECIAL CONSIDERATIONS
  695. The Status function does not move memory. However, you should be sure the device driver does not move memory in response to a status request before you call this function at interrupt time.
  696. RESULT CODES
  697. noErr    0    No error
  698. statusErr    –18    Driver can’t respond to this status request
  699. badUnitErr    –21    Reference number out of range or not in use
  700. unitEmptyErr    –22    DCE points to null driver
  701. notOpenErr    –26    Driver isn’t open
  702. abortErr    –27    Status request aborted by KillIO
  703. SEE ALSO
  704. For information about the low-level routine for monitoring device drivers, see the next section, which describes the PBStatus function.
  705. 1PBStatus
  706. You can use the PBStatus function to obtain status information from a device driver.
  707. FUNCTION PBStatus (paramBlock: ParmBlkPtr;
  708.                                      async: Boolan): OSErr;
  709. paramBlock        Contains a pointer to the parameter block.
  710. async    Specifies to the Device Manager whether the request is asynchronous. 
  711. You specify values and receive return values in a Device Manager parameter block.
  712. <symbol\>\xae     ioCompletion    ProcPtr    Pointer to completion routine.
  713. <symbol\>\xac     ioResult    OSErr    Result code.
  714. <symbol\>\xae     ioVRefNum    Integer    Drive number.
  715. <symbol\>\xae     ioCRefNum    Integer    Driver reference number.
  716. <symbol\>\xae     csCode    Ptr    Type of status call.
  717. <symbol\>\xac     csParam    ARRAY[1..10] OF Integer    
  718.                     Status information.
  719. DESCRIPTION
  720. The PBStatus function returns information about the device driver having the reference number specified by the ioCRefNum field. The value you pass in the csCode field and the information received in the csParam field depend on the driver being called. For more information, see the specific chapters for the standard drivers.
  721. SPECIAL CONSIDERATIONS
  722. The PBStatus function does not move memory. However, you should be sure the device driver does not move memory in response to a status request before you call this function at interrupt time.
  723. ASSEMBLY-LANGUAGE INFORMATION
  724. The trap macro for the PBStatus function is _Status ($A005). Set bit 10 of the trap word to execute this routine asynchronously. Set bit 9 to execute it immediately.
  725. You must setup register A0 with the address of the parameter block. When _Status returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  726. Registers on entry
  727. A0    address of the parameter block
  728. Registers on exit
  729. D0    result code
  730. RESULT CODES
  731. noErr    0    No error
  732. statusErr    –18    Driver can’t respond to this status request
  733. badUnitErr    –21    Reference number out of range or not in use
  734. unitEmptyErr    –22    DCE points to null driver
  735. notOpenErr    –26    Driver isn’t open
  736. abortErr    –27    Status request aborted by KillIO
  737. SEE ALSO
  738. For information about the high-level routine for monitoring device drivers, see the previous section, which describes the Status function.
  739. 1KillIO
  740. You can use the KillIO function to terminate all current and pending I/O with a device driver.
  741. FUNCTION KillIO (refNum: Integer): OSErr;
  742. refNum    Contains the reference number identifying the driver.
  743. DESCRIPTION
  744. The KillIO function stops any current I/O request being processed by the driver indicated by the ioRefNum field and removes all pending I/O requests from the request queue for that driver. The Device Manager calls the completion routine for each pending I/O request with the ioResult field of each request equal to the result code abortErr.
  745. The Device Manager passes KillIO requests to a driver only if the driver is open and enabled for control calls.
  746. The KillIO function terminates all pending I/O for a driver, including I/O initiated by other applications.<36pt\>\x12 <8bat\>s
  747. SPECIAL CONSIDERATIONS
  748. The KillIO function does not move memory. However, you should be sure the device driver does not move memory in response to this request before you call this function at interrupt time.
  749. RESULT CODES
  750. noErr    0    No error
  751. statusErr    –18    Driver can’t respond to this status request
  752. badUnitErr    –21    Reference number out of range or not in use
  753. unitEmptyErr    –22    DCE points to null driver
  754. notOpenErr    –26    Driver isn’t open
  755. SEE ALSO
  756. For information about the low-level routine for terminating pending requests for a driver, see the next section, which describes the PBKillIO function.
  757. 1PBKillIO
  758. You can use the PBKillIO function to terminate all current and pending I/O with a device driver.
  759. FUNCTION PBKillIO (paramBlock: ParmBlkPtr;
  760.                                       async: Boolean) : OSErr;
  761. paramBlock    Contains a pointer to the parameter block.
  762. async    Specifies to the Device Manager whether the request is asynchronous. You should always set this parameter to FALSE.
  763. You specify values and receive return values in a Device Manager parameter block.
  764. <symbol\>\xae     ioCompletion    ProcPtr    Pointer to completion routine
  765. <symbol\>\xac     ioResult    OSErr    Result code
  766. <symbol\>\xae     ioCRefNum    Integer    Driver reference number
  767. DESCRIPTION
  768. The PBKillIO function stops any current request being processed by the driver indicated by the ioCRefNum field and removes all pending requests from the driver’s request queue. The Device Manager calls the completion routine for each pending request with the ioResult field of each request equal to the result code abortErr. 
  769. The Device Manager always executes the PBKillIO routine immediately; that is, it never places a PBKillIO request in a driver’s request queue. However, you should not call this routine immediately—always call the PBKillIO routine synchronously.
  770. Note that the Device Manager passes PBKillIO requests to a driver only if the driver is open and enabled for control calls.
  771. The PBKillIO function terminates all pending requests for a driver, including requests initiated by other applications.<36pt\>\x12 <8bat\>s
  772. SPECIAL CONSIDERATIONS
  773. The PBKillIO function does not move memory. However, you should be sure the device driver does not move memory in response to this request before you call this function at interrupt time.
  774. ASSEMBLY-LANGUAGE INFORMATION
  775. The trap macro for the PBKillIO function is _KillIO ($A006). You must setup register A0 with the address of the parameter block. When _KillIO returns, register D0 contains the result code. Register D0 is the only register affected by this routine.
  776. Registers on entry
  777. A0    address of the parameter block
  778. Registers on exit
  779. D0    result code
  780. RESULT CODES
  781. noErr    0    No error
  782. statusErr    –18    Driver can’t respond to this status request
  783. badUnitErr    –21    Reference number out of range or not in use
  784. unitEmptyErr    –22    DCE points to null driver
  785. notOpenErr    –26    Driver isn’t open
  786. SEE ALSO
  787. For information about the high-level routine for terminating pending requests for a driver, see the previous section, which describes the KillIO function.
  788. Summary of the Device Manager
  789. This section lists the definitions and declarations provided in this chapter. You can find advanced Device Manager information in the “Summary” section of the chapter “Writing Your Own Device Driver,” in this book.
  790. Constants
  791. CONST
  792.     {Positioning modes}
  793.     fsAtMark    = 0;                                         {at current position}
  794.   fsFromStart = 1;                                             {offset from beginning}
  795.   fsFromMark  = 2;                                             {offset from current position}
  796.     {Read modes}
  797.     rdVerify   = 64;                                         {read-verify mode}
  798. Data Types
  799.     ParamBlkType = {ioParam, fileParam, volumeParam, cntrlParam};
  800.  
  801.     ParamBlockRec = 
  802.     RECORD
  803.         qLink:                    QElemPtr;                {next queue entry}
  804.         qType:                    Integer;                {queue type}
  805.         ioTrap:                    Integer;                {routine trap}
  806.         ioCmdAddr:                    Ptr;                {routine address}
  807.         ioCompletion:                    ProcPtr;                {completion routine}
  808.         ioResult:                    OSErr;                {result code}
  809.         ioNamePtr:                    StringPtr;                {driver name}
  810.         ioVRefNum    :                Integer;                {volume reference or drive number}
  811.         CASE ParamBlkType OF
  812.             ioParam:
  813.                  (ioRefNum:                 Integer;                    {driver reference number}
  814.                  ioVersNum:                 SignedByte;                    {not used}
  815.                  ioPermssn:                 SignedByte;                    {read/write permission}
  816.                  ioMisc:                 Ptr;                    {not used}
  817.                  ioBuffer:                 Ptr;                    {pointer to data buffer}
  818.                  ioReqCount:                 LongInt;                    {requested number of bytes}
  819.                  ioActCount:                 LongInt;                    {actual number of bytes}
  820.                  ioPosMode:                 Integer;                    {positioning mode}
  821.                  ioPosOffset:                 LongInt);                    {positioning offset}
  822.             cntrlParam:
  823.                  (ioCRefNum:                 Integer;                    {driver reference number}
  824.                  csCode:                 SignedByte;                    {type of request}
  825.                  csParam:                 ARRAY[1..10] OF Integer);                                
  826.                                                     {control or status info}
  827.             END;
  828.         END;
  829. Routines
  830. Opening and Closing Device Drivers
  831. FUNCTION OpenDriver                                        (name: Str255;
  832.      VAR refNum: Integer): OSErr;
  833. FUNCTION PBOpen                                (paramBlock: ParmBlkPtr;
  834.      async: Boolean): OSErr;
  835. FUNCTION OpenSlot                        (paramBlock: ParmBlkPtr;
  836.      async: Boolean): OSErr;
  837. FUNCTION CloseDriver                                        (refNum: Integer): OSErr;
  838. FUNCTION PBClose                                (paramBlock: ParmBlkPtr;
  839.      async: Boolean): OSErr;
  840. Reading From and Writing To Device Drivers
  841. FUNCTION FSRead                            (refNum: Integer;
  842.      VAR count: LongInt;
  843.      buffPtr: Ptr): OSErr;
  844. FUNCTION PBRead                    (paramBlock: ParmBlkPtr;
  845. async: Boolean): OSErr;
  846. FUNCTION FSWrite    (refNum: Integer:
  847.                                 VAR count: LongInt;
  848.                                 buffPtr: Ptr): OSErr;
  849. FUNCTION PBWrite    (paramBlock: ParmBlkPtr;
  850.                                 async: Boolean): OSErr;
  851. Controlling and Monitoring Device Drivers
  852. FUNCTION Control                                    (refNum: Integer;
  853.                                     csCode: Integer;
  854.                                     csParamPtr: Ptr): OSErr;
  855. FUNCTION PBControl    (paramBlock: ParmBlkPtr;
  856.                                 async: Boolean): OSErr;
  857. FUNCTION Status                                    (refNum: Integer;
  858.                                 csCode: Integer;
  859.                             csParamPtr: Ptr): OSErr;
  860. FUNCTION PBStatus    (paramBlock: ParmBlkPtr;
  861.                                 async: Boolean): OSErr;
  862. FUNCTION KillIO                                 (refNum: Integer): OSErr;
  863. FUNCTION PBKillIO    (paramBlock: ParmBlkPtr;
  864.                                 async: Boolean): OSErr;
  865. Result Codes
  866. noErr    0    No Error
  867. controlErr    –17    Driver can’t respond to this control request
  868. statusErr    –18    Driver can’t respond to this status request
  869. readErr    –19    Driver can’t respond to read requests
  870. writErr    –20    Driver can’t respond to write requests
  871. badUnitErr    –21    Bad reference number
  872. unitEmptyErr    –22    Bad reference number
  873. openErr    –23    Driver can’t perform requested reading or writing
  874. dInstErr    –26    Couldn’t find driver in resource file
  875. dRemovErr    –26    Attempt to remove an open driver
  876. notOpenErr    –26    Driver isn’t open
  877. abortErr    –27    Request aborted by KillIO
  878. ioErr    –36    Data doesn’t match in read-verify mode
  879. Assembly-Language Information
  880. Device Manager Parameter Block
  881.     0    qLink    used internally by the Device Manager    
  882.     4    qType    used internally by the Device Manager    
  883.     6    ioTrap    used internally by the Device Manager    
  884.     8    ioCmdAddr    used internally by the Device Manager    
  885. <symbol\>\xae     12    ioCompletion    completion routine    
  886. <symbol\>\xac     16    ioResult    result code    
  887. <symbol\>\xae     18    ioNamePtr    driver name    
  888. <symbol\>\xae     22    ioVRefNum    drive number    
  889. <symbol\>\xae     24    ioRefNum    driver reference number    
  890.     26    ioVersNum    not used    
  891. <symbol\>\xae     28    ioPermssn    read/write permission    
  892.     30    ioMisc    not used    
  893. <symbol\>\xae     32    ioBuffer    pointer to data buffer    
  894. <symbol\>\xae     36    ioReqCount    requested number of bytes    
  895. <symbol\>\xac     40    ioActCount    actual number of bytes    
  896. <symbol\>\xae     44    ioPosMode    positioning mode    
  897. <symbol\>\xab     46    ioPosOffset    positioning offset    
  898. <symbol\>\xae     24    ioCRefNum    driver reference number    
  899. <symbol\>\xae     26    csCode    type of control or status request    
  900. <symbol\>\xab     28    csParam    control or status information    
  901.     28    ioMix    reserved for use by slot driver’s open routine    
  902. <symbol\>\xae     32    ioFlags    determines number of additional fields     for OpenSlot
  903. <symbol\>\xae     34    ioSlot    slot number    
  904. <symbol\>\xae     35    ioId    slot resource ID
  905.             
  906. <symbol\>\xae     34    ioSEBlkPtr    pointer to external parameter block    
  907. Trap Macros
  908. Trap Macro    Trap Word
  909. _Open    $A000
  910. _Close    $A001
  911. _Read    $A002
  912. _Write    $A003
  913. _Control    $A004
  914. _Status    $A005
  915. _KillIO    $A006
  916.     
  917. Writing Your Own 
  918. Device Driver
  919. Writing a Device Driver2-3
  920. How the Device Manager Works2-3
  921. Creating a Driver Resource2-5
  922. Responding to the Device Manager2-10
  923. Entering and Exiting From Driver Subroutines2-10
  924. Writing the Open and Close Subroutines2-11
  925. Writing the Prime Subroutine2-14
  926. Writing the Control and Status Subroutines2-15
  927. Handling I/O Asynchronously2-18
  928. Installing the Driver2-19
  929. Writing a Chooser-Compatible Device Driver2-22
  930. How the Chooser Works2-22
  931. Creating a Chooser Extension File2-25
  932. Creating a Device Package2-27
  933. Responding to the Chooser2-29
  934. Allocating private storage2-32
  935. Writing a Desk Accessory2-33
  936. How Desk Accessories Work2-33
  937. Creating a Driver Resource for a Desk Accessory2-34
  938. Opening and Closing a Desk Accessory2-34
  939. Responding to Events2-35
  940. Reference2-36
  941. Data Structures2-36
  942. The Extended Device Control Entry2-37
  943. Routines2-38
  944. Resources2-41
  945. Summary2-43
  946. 2Writing Your Own Device Driver
  947. This chapter describes how to write a device driver, how your device driver can use the Chooser, and how to make your device driver into a desk accessory.
  948. Although this chapter describes some of the internal mechanisms of the Device Manager, you do not need to read this chapter if you want to use the Device Manager to communicate with an already-existing device driver. See the chapter “The Device Manager” instead.
  949. If you do want to write your own device driver, or just learn about how the Device Manager interacts with device drivers, you should first read the chapter “The Device Manager” and then read this chapter.
  950. This chapter shows how you can
  951. n    create a device driver that responds to Device Manager requests
  952. n    provide a user interface for your driver with the Chooser
  953. n    create a desk accessory
  954. You should read the first section of this chapter, which describes how to write a basic device driver, before reading the sections on the Chooser or desk accessories.
  955. Writing a Device Driver
  956. This section shows you how to write a basic device driver—one that can respond to Device Manager requests. You should read this section before reading “Writing a Chooser-Compatible Device Driver” on page 2-21 or “Writing a Desk Accessory” on page 2-31. 
  957. To write a device driver, you need to know 
  958. n    how the Device Manager opens drivers, maintains data structures about them, and communicates with them
  959. n    how to create a driver resource
  960. n    how the code in your driver resource should respond to Device Manager requests
  961. The next few sections examine these topics.
  962. How the Device Manager Works
  963. The Device Manager communicates with device drivers by calling one of five driver subroutines: Open, Prime, Control, Status, and Close. All drivers must have an Open and Close subroutine; the Prime, Control, and Status subroutines are optional.
  964. Each driver subroutine is responsible for handling certain types of Device Manager requests. 
  965. Device Manager routines        Responsible driver subroutine
  966. OpenDriver, PBOpen, OpenSlot        Open
  967. FSRead, PBRead        Prime
  968. FSWrite, PBWrite        Prime
  969. Status, PBStatus        Status
  970. Control, PBControl        Control
  971. KillIO, PBKillIO        Control    
  972. CloseDriver, PBClose        Close
  973. The Device Manager routines are listed by their actual names. The corresponding driver subroutine names are descriptive names. You can choose any name for your actual driver routines—the Device Manager locates them using offsets you provide.<36pt\>\x12 <8bat\>u
  974. When an application or another manager calls the OpenDriver function, the Device Manager searches the unit table to see if a driver with the specified name is already open. If no open driver has a matching name, the Device Manager opens the driver resource with the specified name. To open a driver from a resource, the Device Manager
  975. n    loads the driver code from the resource into memory
  976. n    creates a device control entry for it, filling it in with values from the header of the driver resource,
  977. n    installs the device control entry in the unit table at a location determined by the driver resource ID
  978. n    calls the driver’s Open subroutine.
  979. The header of the driver resource contains information about the driver such as which driver subroutines are implemented and where the subroutines are. See “Creating a Driver Resource” on page 2-5 for the format of the driver header.
  980. Unlike the OpenDriver function, the PBOpen and OpenSlot functions expect the driver to be already installed. These functions search the unit table for the driver’s device control entry and call the driver’s Open subroutine.
  981. If you use the PBOpen or OpenSlot function to open your driver, you are responsible for creating the device control entry and installing it in the unit table. Even if you use the OpenDriver function to install your driver, you are responsible for finding an empty space in the unit table, which may require allocating more memory for it. The section “Installing the Driver” on page 2-18 discusses the device control entry, the unit table, and how you can properly install your driver.
  982. To allow asynchronous requests, the Device Manager maintains a driver request queue for each open driver. A driver request queue is a standard Operating System queue, as described in the chapter “Operating System Utilities” in the Inside Macintosh: Operating System volume. 
  983. When an application or another manager calls the PBRead, PBWrite, PBStatus, or PBControl routine, the Device Manager places the parameter block at end of the driver’s request queue. The high-level versions of these routines create a parameter block (filling the fields with the values of the parameters sent to routine where possible and using default values for the rest) and add it to the request queue. As previously-queued requests are satisfied, the parameter block moves forward in the request queue. When the parameter block is at the beginning of the request queue, the Device Manager calls the appropriate driver subroutine and passes it a pointer to the parameter block and a pointer to the driver’s device control entry.
  984. For reading and writing requests, the Device Manager calls the Prime subroutine, described in “Writing the Prime Subroutine” on page 2-13. This subroutine can execute synchronously, completing the requested reading or writing before returning control to the Device Manager, or asynchronously, beginning the requested transaction but returning control to the Device Manager before the completing it. If the driver’s Prime routine can execute asynchronously, the driver must use some mechanism to regain control of the processor and complete the request. Typically these drivers provide interrupt handlers that respond to interrupts from the driver’s device and notify the Device Manager when the transaction is complete. See “Handling I/O Asynchronously” on page 2-17 for more details.
  985. The Device Manager handles controlling and monitoring requests in the same way as reading and writing requests, except that for controlling requests it calls the Control subroutine and for monitoring requests it calls the Status subroutine. The section “Writing the Control and Status Subroutines” on page 2-15 shows how to provide these subroutines for your driver.
  986. The Device Manager responds to KillIO requests by removing the parameter blocks from the queue, calling their completion routines with the result code abortErr, and then calling the drivers Control subroutine with a value of killCode for the csCode parameter. You can find information on handling KillIO requests in “Writing the Control and Status Subroutines” on page 2-15.
  987. In response to a closing request, the Device Manager queues the parameter block, making one if necessary. Since closing requests cannot be asynchronous, the Device Manager sends each queued request to the driver. Since the last request is the closing request, the Device Manager ultimately calls the Close subroutine. When the driver indicates it has satisfied the closing request, the Device Manager unlocks the device control entry and the driver code. Note that the Device Manager does not dispose of the device control entry or even remove it from the unit table. 
  988. The section “Writing the Open and Close Subroutines” on page 2-11 shows how your driver can respond to both opening and closing requests.
  989. Creating a Driver Resource
  990. You will probably want to store your driver in a driver resource, although if you are writing a driver for a slot device you might want to store your driver in the declaration ROM of the expansion card (see Designing Cards and Drivers for the Macintosh Family for more details). Storing your driver in a driver resource allows the OpenDriver function to load your driver code into memory and install a device control entry for your driver in the unit table.
  991. Like all resources, your driver resource has a resource type, a resource ID, a resource name, and resource attributes:
  992. n    The resource type must be 'DRVR'.
  993. n    The resource ID determines where in the unit table the OpenSlot function installs the driver’s device control entry. Unfortunately, you must choose the resource ID when creating your driver resource and you cannot know which unit numbers will be available until you open your driver. Therefore, your driver-opening routine must find an empty location in the unit table and change the resource ID accordingly. The section “Installing the Driver” on page 2-18 discusses appropriate values for the resource ID.
  994. n    The resource name should be the same as the driver name so that the OpenDriver function can find the driver resource. A driver name consists of a period (.) followed by any sequence of 1 to 254 printing characters. The Device Manager ignores case (but not diacritical marks) when comparing names.
  995. n        The resource attributes of your driver resource depend on your driver. A typical driver might have these attributes: locked, since most drivers contain code that is called at interrupt time; in the system heap, so that the driver exists over launches of applications; and preloaded, which makes resource loading slightly more efficient.
  996. A driver resource has two parts:
  997. n        a driver header that contains information about the driver
  998. n        the routines that do the work of the driver
  999. The driver header contains a few words of flags and other data, offsets to the driver’s routines, and an optional driver name. Figure 2-1 shows the format of a driver header.
  1000. The format of a driver header
  1001. drvrFlags    Contains flags in its high-order byte that specify certain characteristics of the driver. You can use the constants in Listing 2-1 to index the flags in this field.
  1002. drvrDelay    Indicates number of ticks between periodic actions.
  1003. drvrEMask    Used for desk accessories. See “Writing a Desk Accessory” on page 2-31 for information about this field.
  1004. drvrMenu    Used for desk accessories. See “Writing a Desk Accessory” on page 2-31 for information about this field
  1005. drvrOpen    Contains an offset to the Open driver subroutine.
  1006. drvrPrime    Contains an offset to the Prime driver subroutine.
  1007. drvrCtl    Contains an offset to the Control driver subroutine.
  1008. drvrStatus    Contains an offset to the Status driver subroutine.
  1009. drvrClose    Contains an offset to the Close driver subroutine.
  1010. drvrName    Contains the driver name. You can use uppercase and lowercase letters when naming your driver, but the first character should be a period—.YourDriver, for example.
  1011. See the section “Entering and Exiting From Driver Subroutines” on page 2-9 for more information about the subroutine offsets.
  1012. Your driver routines, which follow the driver header, must be aligned on a word boundary.<36pt\>\x12 <8bat\>u
  1013. The index constants for the drvrFlags field
  1014. dReadEnable                             EQU        0 ;set if driver can respond to Read requests
  1015. dWritEnable                             EQU        1 ;set if driver can respond to Write requests
  1016. dCtlEnable                             EQU        2 ;set if driver can respond to Control requests
  1017. dStatEnable  EQU                                    3 ;set if driver can respond to Status requests
  1018. dNeedGoodbye                             EQU        4 ;set if driver needs to be called before the
  1019.                                       ; application heap is initialized
  1020. dNeedTime                               EQU        5 ;set if driver needs time for performing
  1021.                                       ; periodic tasks
  1022. dNeedLock                                EQU        6 ;set if driver will be locked in memory as
  1023.                                       ; soon as it's opened
  1024. The first four flags, which occupy bits 0–3 of the high-order byte (bits 8–11 of the drvrFlags word), indicate which Device Manager requests the driver’s routines can respond to. The next section, “Responding to the Device Manager,” on page 2-9 describes these routines in detail. 
  1025. Drivers in the application heap are lost when the heap is reinitialized. If you set the dNeedGoodbye flag, the Device Manager calls your driver before the heap is reinitialized so that you can perform any clean-up actions. See “Writing the Control and Status Subroutines” on page 2-15 for more details. 
  1026. You set the dNeedTime flag of the drvrFlags word if your device driver needs to perform some action periodically. For example, a network driver may want to poll its input buffer every 5 seconds to see if it has received any messages. The value of the drvrDelay word indicates how many ticks should pass between periodic actions. For example, a value of 0 in the drvrDelay word indicates that the action should happen as often as possible, a value of 1 means it should happen every sixtieth of a second, a value of 2 means at most every thirtieth of a second, and so on. Whether the action actually occurs this frequently depends on how often the application calls the Desk Manager procedure SystemTask. See “Writing the Control and Status Subroutines” on page 2-15 for more details.
  1027. If you do not want your driver to depend on applications to call SystemTask, you can still perform actions periodically by installing a VBL task, a Deferred Task Manager task, a Time Manager task, or a Notification Manager task. For more information, see the chapters corresponding to these managers.<36pt\>\x12 <8bat\>u
  1028. You need to set the dNeedLock flag if your driver’s code should be locked in memory. In particular, you need to set this flag in these two cases:
  1029. n    If any part of your driver’s code can be called at interrupt time. At interrupt time, the heap may not be in a consistent state. If your driver is not locked, the system could be in the process of relocating it in memory.
  1030. n    If your driver provides the Operating System with a pointer to any part of its code. For example, if your driver uses the Device Manager to call another driver, you might provide the Device Manager with a pointer to completion routine. If that completion routine is in your driver code, your driver code must be locked. Otherwise, that pointer might not be valid by the time the Device Manager calls the completion routine.
  1031. You can create your driver header in these ways:
  1032. n    You can use a resource compiler. See “Resources” on page 2-38 for the Rez format of the driver resource.
  1033. n    You can use the DC instruction, as shown in Listing 2-2, to position the header information directly in your assembly language code.
  1034.  An assembly-language driver header
  1035. DHeader
  1036. DFlags                        DC.B        0                         ;set by DRVROpen
  1037.                         DC.B        0                         ;set by DRVROpen
  1038. DDelay                        DC.W        0                         ;none
  1039. DEMask                        DC.W        0                         ;DA event mask
  1040. DMenu                        DC.W        0                         ;no menu
  1041.                         DC.W        DOpen     - DHeader                     ;offset to Open
  1042.                         DC.W        DPrime     - DHeader                     ;offset to Prime
  1043.                         DC.W        DControl - DHeader                         ;offset to Control
  1044.                         DC.W        DStatus     - DHeader                     ;offset to Status
  1045.                         DC.W        DClose     - DHeader                     ;offset to Close
  1046.  
  1047. Name                        DC.B        '.DRIVER'                         ;name of driver
  1048.                         ALIGN        2                         ;word align
  1049. In this example, the drvrFlags word is cleared to 0—the actual flags are set in the DRVROpen routine, defined in “Writing the Open and Close Subroutines” on page 2-11. The drvrDelay field is set to 0 and the drvrEMask and drvrMenu fields are set to 0, as this driver is not a desk accessory. The next five fields give offsets to the driver subroutines, defined in the next section, “Responding to the Device Manager.” The header ends with the driver name and word alignment.
  1050. Responding to the Device Manager
  1051. The Device Manager calls a driver subroutine by setting up registers and jumping to the address indicated by the subroutine’s offset in the driver header. 
  1052. n        Register A0 contains a pointer to the parameter block. 
  1053. n        Register A1 contains a pointer to the device control entry.
  1054. This interface requires you to use some assembly language when writing a driver. However, you can write your driver subroutines in a high-level language if you provide an assembly-language dispatching mechanism that acts as an interface between the Device Manager and your driver subroutines.
  1055. The next few sections discuss how you can provide a dispatching routine and how you can implement your driver subroutines in a high-level language.
  1056. Entering and Exiting From Driver Subroutines
  1057. Listing 2-3 shows an assembly-language routine that you can use an interface between the Device Manager and your high-level language driver subroutines. In this example, each driver subroutine (which the Device Manager locates using the offsets defined in Listing 2-2) pushes the address of its corresponding high-level language subroutine and then branch to the dispatching routine.
  1058. Entering and exiting from driver subroutines
  1059. DOpen                        pea        DRVROPEN
  1060.                         bra.s        DRVRDispatch                         
  1061.                 
  1062. DPrime                        pea        DRVRPRIME
  1063.                         bra.s        DRVRDispatch
  1064.                 
  1065. DControl                        pea        DRVRCONTROL
  1066.                         bra.s        DRVRDispatch                        
  1067.  
  1068. DStatus                        pea        DRVRSTATUS
  1069.                         bra.s        DRVRDispatch
  1070.  
  1071. DClose                        pea        DRVRCLOSE                         ;and fall thru to DRVRDispatch
  1072.  
  1073. DRVRDispatch
  1074.                         movem.l            a0/a1, -(sp)                     ;save registers (for IODone)
  1075.                         clr.w            -(sp)                     ;save room for result 
  1076.                         move.l            a0, -(sp)                     ;push paramblock ptr on stack
  1077.                         move.l            a1, -(sp)                       ;push dce ptr on stack
  1078.                         movea.l             $12(sp), a0                     ;load address of routine into a0
  1079.                         jsr            (a0)                     ;jump to actual subroutine
  1080.                         move.w            (sp)+, d0                     ;put result into d0                
  1081.                         movem.l            (sp)+, a0/a1                     ;restore registers (for IODone)
  1082.                         addq.w            #4, a7                     ;clear subroutine addr off stack
  1083.  
  1084.                         cmp.w            #1, d0                    ;if incomplete async routine
  1085.                         beq.s            Done                     ;then rts -- don't jmp to IODone
  1086.  
  1087.                         btst            #1,$6(a0)                    ;test immediate bit
  1088.                         bne.s            Done                    ;rts if immed bit set
  1089.                         move.l            JIODone, -(sp)                    ;push JIODone vector onto stack
  1090.  
  1091. Done                        rts
  1092. The DRVRDispatch routine begins by saving the A0 and A1 registers, clearing room on the stack for the result code, and pushing the parameters on the stack and jumping to the appropriate driver subroutine. 
  1093. When the driver subroutine returns, the DRVRDispatch routine moves the result code to register D0, restores the A0 and A1 registers, clears the subroutine address from the stack, and then returns control to the Device Manager in one of two ways:
  1094. n    With an RTS instruction. You do not want the Device Manager to remove to the request from the driver request queue. In particular, the DRVRDispatch routine returns with an RTS instruction from immediate requests (which the Device Manager never adds to the queue) and from incomplete requests that the driver is executing asynchronously (which should remain in the queue until the driver completes them). The driver subroutines return a result code of 1 to indicate that the request is still incomplete.
  1095. n    By jumping to the IODone routine. This routine, described in detail on page 2-38, indicates to the Device Manager that the request is complete. The Device Manager will remove the request from the driver request queue and call the completion routine. 
  1096. The next few sections discuss how to write your driver subroutines.
  1097. Writing the Open and Close Subroutines
  1098. You must provide both an Open subroutine and a Close subroutine for your driver. The Device Manager always executes these routines as synchronous requests and they should return by means of an RTS instruction.
  1099. Your Open routine must allocate any private storage that your driver requires and store a handle to this storage in the dCtlStorage field of the device control entry. 
  1100. After allocating private storage, you should initialize it and do any further preparation required by your driver.
  1101. You might also install interrupt handlers, change interrupt vectors, and store a pointer to the device control entry somewhere in local storage for the interrupt handlers to use. The section “Handling I/O Asynchronously” on page 2-17 discusses interrupt handling in more detail.
  1102. The DrvrDispatch routine in Listing 2-3 returns the result codes of the driver subroutines in register D0. However, upon return from the Open subroutine, the Device Manager sets register D0 to 0; therefore, your Open routine should place the result code in the ioResult field of the parameter block. 
  1103. Listing 2-4 shows a sample Open subroutine, DRVROpen. The DRVROpen function begins by setting the flags of the device control entry (see Listing 2-2 on page 2-9) and checking whether the driver is already open (by examining the contents of the dCtlStorage field of the device control entry). If the driver is not already open, the DRVROpen function allocates memory for private storage. The private storage of the driver in this example contains two fields: the numBeeps field stores a value of type LongInt, and the buffer field stores a buffer of 255 bytes. The Prime, Control, and Status subroutines described in the next two sections use these fields.
  1104. If the DRVROpen function fails to allocate memory for private storage, it returns with an openErr result code. The DRVRDispatch routine returns this result code in register D0, which notifies the Device Manager that the driver did not open. If the memory allocation succeeds, the DRVROpen function places a noErr result code in the ioResult field of the parameter block.
  1105. Sample Open driver subroutine
  1106. TYPE
  1107.                 MyDriverGlobals = RECORD
  1108.                     numBeeps    : LongInt;
  1109.                     buffer        : Str255;
  1110.                 END;
  1111.                 MyDriverGlobalsPtr    = ^MyDriverGlobals;
  1112.                 MyDriverGlobalsHdl    = ^MyDriverGlobalsPtr;
  1113.  
  1114. FUNCTION DRVROpen (VAR pb: ParamBlockRec; 
  1115.                                      VAR dce: DCtlEntry): OSErr;
  1116.  
  1117. BEGIN
  1118.                 DRVROpen := NoErr;
  1119.                 dce.dCtlFlags := BOr(dCtlEnable + dStatEnable + dWritEnable 
  1120.                                             + dReadEnable + dNeedLock  + dRAMBased,
  1121.                                             dce.dCtlFlags);
  1122.                     
  1123.                 IF (dce.dCtlStorage <> NIL) THEN
  1124.                     BEGIN
  1125.                         {driver is already open}
  1126.                     END
  1127.                 ELSE                                
  1128.                     BEGIN {need to initialize dCtlStorage}
  1129.                         dce.dCtlStorage := NewHandle(sizeof(MyDrvrGlobals));
  1130.                         IF (dce.dCtlStorage = NIL) THEN
  1131.                             DRVROpen := openErr
  1132.                         ELSE
  1133.                             pb.ioResult := noErr;
  1134.                     END;
  1135. END;
  1136. Your Close subroutine must reverse the effects of your Open subroutine by releasing any used memory, removing interrupt handlers, removing any VBL or Time Manager tasks, and replacing changed interrupt vectors. 
  1137. If you want to save any information about the operational state of the driver until the next time the driver is opened, you should store this information in a relocatable block of memory pointed to by the dCtlStorage field, because the Device Manager does not dispose of the device control entry when a driver is closed.
  1138. Listing 2-5 shows a sample Close subroutine, DRVRClose. Since the DRVROpen function for this sample driver allocated private storage, and the driver doesn’t need to store any information until the next time its opened, the DRVRClose function simply disposes the private storage.
  1139. Sample Close driver subroutine
  1140. FUNCTION DRVRClose (VAR pb: ParamBlockRec; 
  1141.                                       VAR dce: DCtlEntry): OSErr;
  1142.  
  1143.                 BEGIN
  1144.                     IF (dce.dCtlStorage <> nil) THEN
  1145.                         BEGIN
  1146.                             DisposHandle(dce.dCtlStorage);
  1147.                             dce.dCtlStorage := nil;
  1148.                         END;
  1149.  
  1150.                     DRVRClose := NOErr;
  1151.                 END;
  1152. Writing the Prime Subroutine
  1153. Your Prime routine implements the I/O requests. You can write your Prime subroutine to execute synchronously or asynchronously. A synchronous Prime subroutine completes an entire I/O request before returning to the Device Manager. An asynchronous Prime subroutine can begin an I/O transaction but return to the Device Manager before the request is complete. In this case, the I/O request continues to be executed, typically when more data is available, by other routines such as interrupt handlers or completion routines. The section “Handling I/O Asynchronously” on page 2-17 discusses how to complete an asynchronous Prime subroutine.
  1154. Notice the difference between asynchronous requests and asynchronous subroutines. The Device Manager places asynchronous requests in the request queue and returns control to the application right away. Asynchronous subroutines are capable of satisfying a large request in small pieces, one piece at a time.<36pt\>\x12 <8bat\>u
  1155. The Device Manager indicates whether it is requesting a Read or a Write operation by placing one of the following constants in the low-order byte of the ioTrap field of the parameter block:
  1156.     aRdCmd                    EQU        2                        ;Read operation requested
  1157.     aWrCmd                    EQU        3                        ;Write operation requested
  1158. The Device Manager provides two routines—Fetch and Stash—that provide low-level support for reading and writing characters to and from data buffers. Use of these routines is optional. The section “Routines” on page 2-36 describes these routines in detail.
  1159. The Fetch and Stash routines update the ioActCount field of the parameter block. If you do not use these routines, you are responsible for updating this field. 
  1160. If your driver serves a block device, you should update the dCtlPosition field of the device control entry. 
  1161. Listing 2-4 shows a sample Prime subroutine, DRVRPrime. The DRVRPrime function allows applications to read and write up to 255 bytes of data to its private data buffer. 
  1162. The DRVRPrime function checks the requested byte count and lowers it if it is greater than the size of the private buffer. Then, the function examines the low-order byte of the ioTrap field of the parameter block to determine whether the Device Manager is requesting a read operation or a write operation. The function then moves the requested number of from its private storage to the buffer designated by the parameter block for a read operation, or from the designated buffer to its private storage for a write operation. (A real driver would probably send the data to or request the data from a hardware device, instead of storing the data itself.)
  1163. The DRVRPrime function then updates the ioActCount field appropriately.
  1164. Sample Prime driver subroutine
  1165. FUNCTION DRVRPrime (VAR pb: ParamBlockRec; 
  1166.                                       VAR dce: DCtlEntry): OSErr;
  1167.                 VAR
  1168.                     dStore        : MyDriverGlobalsHdl;
  1169.                     callType    : Integer;
  1170.                     numBytes    : LongInt;
  1171.  
  1172.                 BEGIN
  1173.                     DRVRPrime := NoErr;
  1174.     
  1175.                     IF (dce.dCtlStorage <> nil) THEN
  1176.                         BEGIN
  1177.                             dStore := MyDriverGlobalsHdl(dce.dCtlStorage);
  1178.                             numBytes := pb.ioReqCount;
  1179.                             IF numBytes > 256 THEN
  1180.                                 numBytes := 256;
  1181.                             callType := BAND($00FF,pb.ioTrap);
  1182.             
  1183.                             CASE callType OF
  1184.                                 aRdCmd: BlockMove(@dStore^^.buffer,
  1185.                                                         pb.ioBuffer,numBytes);
  1186.                                 aWrCmd:    BlockMove(pb.ioBuffer, 
  1187.                                                       @dStore^^.buffer,numBytes);
  1188.                             END;
  1189.                             pb.ioActCount := numBytes;
  1190.                         END
  1191.                     ELSE
  1192.                         DRVRPrime := mFulErr;
  1193.                 END;
  1194. Writing the Control and Status Subroutines
  1195. Like the Prime subroutine, the Control and Status subroutines that you write can execute synchronously or asynchronously. 
  1196. The Device Manager passes information to the Control routine in the csCode and csParam fields of the parameter block. The csCode field specifies the type of control information and the csParam field, which is up to 22 bytes long, contains the actual control information. The Device Manager reserves some values for the csCode parameter to indicate certain types of control requests. 
  1197. You can identify these requests by checking the csCode field for these constant values:
  1198. Constant name    Value    Meaning             
  1199. killCode    1    KillIO requested
  1200. goodBye    -1    Heap being reinitialized
  1201. accRun    65    Time for periodic action 
  1202. When the Device Manager receives a KillIO request, it removes every parameter block from the driver request queue. If your driver responds to any requests asynchronously, the part of your driver that completes requests begun by the driver subroutines (for example, an interrupt handler) might expect the parameter block for the pending request to be at the head of the request queue. The Device Manager notifies your driver of KillIO requests so that you can take the appropriate actions to stop work on the pending request. You should be certain you return control to the Device Manager by means of an RTS instruction and not by jumping to the IODone routine.
  1203. If you set the dNeedGoodbye flag in the drvrFlags word of your device header, the Device Manager will call your Control routine with the value goodBye in the csCode parameter before the heap is reinitialized. You can respond by performing any clean-up actions necessary before heap reinitialization.
  1204. If you set the dNeedTime flag in the drvrFlags word of your device header, the Device Manager will call your Control routine with the value accRun in the csCode parameter periodically. 
  1205. You can interpret other values of the csCode field as suited for your driver. Your Control routine should accept this control information and manipulate the device as requested.
  1206. Listing 2-7 shows a sample Control subroutine, DRVRControl. The DRVRControl function allows applications to specify a number of times for the driver to produce a system beep. The driver stores the requested number in its private storage.
  1207. The DRVRControl function interprets the value
  1208. CONST                 beepIt         = 100;
  1209. in the csCode field to indicate a request for system beeps. You would define this constant in the constant definition part of your Pascal unit.
  1210. The DRVRControl function examines the csCode field of the parameter block for the beepIt value. If it finds this value, the function examines the csParam field for the number of beeps requested, stores the requested number in private storage, and produces the system beeps.
  1211. Sample Control subroutine
  1212. FUNCTION DRVRControl (VAR pb: ParamBlockRec; 
  1213.                                          VAR dce: DCtlEntry): OSErr;
  1214.                 VAR
  1215.                     dStore        : MyDriverGlobalsHdl;
  1216.                     beepTimes    : Integer;
  1217.         
  1218.                 BEGIN
  1219.                     IF (dce.dCtlStorage <> nil) THEN            
  1220.                         BEGIN
  1221.                             dStore := MyDriverGlobalsHdl(dce.dCtlStorage);
  1222.             
  1223.                             CASE pb.csCode OF
  1224.                                 beepIt: BEGIN
  1225.                                     beepTimes := pb.csParam[0];
  1226.                                     dStore^^.numBeeps:= dStore^^.numBeeps+beepTimes;
  1227.                                     REPEAT
  1228.                                         SysBeep(1);
  1229.                                         beepTimes := beepTimes - 1;
  1230.                                     UNTIL (beepTimes = 0);
  1231.                                 END;
  1232.                             END;
  1233.                             DRVRControl := NoErr;
  1234.                         END;
  1235.                 END; 
  1236. The Status subroutine should work in a similar manner. The Device Manager uses the csCode field to specify the type of status information requested. Your Status routine should be prepared to respond to whatever requests are appropriate for your driver and return the information in the csParam field.
  1237. The Device Manager does not reserve any csCode values for the Status subroutine. However, when the Device Manager receives a Status request with a csCode value of 1, it returns a handle to the driver’s device control entry from the unit table. The driver’s Control subroutine never sees this request.
  1238. Listing 2-7 shows a sample Status subroutine, DRVRStatus. The DRVRStatus function returns the number of beeps requested by the most recent Control request. 
  1239. This function interprets the value
  1240. CONST                 getBeeps         = 100;
  1241. in csCode field to indicate a Status request for number of beeps last requested. You would define this constant in the constant definition part of your Pascal unit.
  1242. Sample Status subroutine
  1243. FUNCTION DRVRStatus (VAR pb: ParamBlockRec; 
  1244.                                         VAR dce: DCtlEntry): OSErr;
  1245.                 VAR
  1246.                     dStore    : MyDriverGlobalsHdl;
  1247.         
  1248.                 BEGIN
  1249.                     IF (dce.dCtlStorage <> nil) THEN
  1250.                         BEGIN
  1251.                             dStore := MyDriverGlobalsHdl(dce.dCtlStorage);
  1252.             
  1253.                             CASE pb.csCode OF
  1254.                                 getBeeps:        
  1255.                                 BEGIN
  1256.                                     pb.csParam[0] := dStore^^.numBeeps;
  1257.                                 END;
  1258.                             END;
  1259.                         END;
  1260.     
  1261.                     DRVRStatus := NoErr;
  1262.                 END;
  1263. Handling I/O Asynchronously
  1264. If you write any of your driver subroutines to execute asynchronously, you must provide a mechanism for your driver to complete the requests.
  1265. Some examples of routines that you might use are:
  1266. n    Completion routines. Your driver subroutine could call another driver to start the data transfer. In this case, you can provide that driver with a completion routine. When the other driver completes the request, the Device Manager executes the completion routine. In the completion routine, you could call the other driver again to execute the next part of the I/O operation. When the entire operation is complete, the completion routine should return by jumping to the IODone routine.
  1267. n    Interrupt handlers. Your driver might serve a device, such as a slot device, that generates interrupts. An interrupt causes the processor to suspend normal execution, save the address of the next instruction and the processor’s internal status on the stack, and execute an interrupt handler. You can create an interrupt handler that continues an I/O operation when the device signals, by an interrupt, that it is ready to continue. Your interrupt handler must preserve any registers it uses and clear the source of the interrupt. You may want your Open routine to store a handle to your driver’s device control entry in your driver’s local storage. You can get a handle to the device control entry using the GetDCtlEntry function. For more information on Macintosh interrupts and how to install your own interrupt handlers, see the Guide to Macintosh Family Hardware and Designing Cards and Drivers for the Macintosh Family.
  1268. n    VBL, Time Manager, and Deferred Task Manager tasks. Installing any of these tasks ensures that your driver receives system time at some point in the future. During this time, you can check to see if the I/O operation is ready to continue.
  1269. Interrupts can occur while your interrupt handler is executing. When this happens, it’s possible for the system to suspend your interrupt handler for the first interrupt and then reenter your interrupt handler for the second interrupt. Your interrupt handler is reentrant if it handles this situation correctly. 
  1270. To help ensure that your driver is reentrant, your driver should store a handle to its private storage in the dCtlStorage field of the device control entry, and not use memory within the driver code itself.u
  1271. If your driver serves a device on an expansion card, you might want to respond to slot interrupts, or interrupts signalled by devices on expansion cards. When a NuBus card device signals a slot interrupt, the CPU can quickly detect which card requested the interrupt service, but not which device on the card. To determine which device caused the interrupt, the system uses a polling procedure. 
  1272. If your driver serves a NuBus card device, it should provide a polling routine—a routine that checks if the device it serves caused the current interrupt, and, if so, calls the proper driver code to handle the interrupt. The Slot Manager maintains a queue of these polling routines for each slot. Your driver can install an element in this queue using the Slot Manager routine SIntInstall. You can also remove a queue element with the Slot Manager routine SIntRemove. The chapter “The Slot Manager” in this book gives more information about the SIntInstall and SIntRemove routines.
  1273. For more information on slot interrupts and writing drivers for slot devices, see Designing Cards and Drivers for the Macintosh Family.
  1274. Installing the Driver
  1275. When you have completed your driver resource, you have a number of options for storing it and installing the driver. Two of the most common are:
  1276. n    Storing the driver resource in an application and having the application install it.
  1277. n    Storing the driver resource in a system extension file and writing an initialization ('INIT') resource to install it.
  1278. In either case, you need to write code to ensure your driver is properly installed and opened before making sending it any requests. You can create a device control entry yourself and install it in the unit table and then use the PBOpen or OpenSlot function to open it, or you can use the OpenDriver function to install and open it.
  1279. If you want to install the driver yourself, see the section “Data Structures” on page 2-34 for details about the device control entry data type.
  1280. If you want to use the OpenDriver function to install your driver, you are responsible for examining the unit table and changing your driver resource ID so that the OpenDriver function install your driver in an empty location in the unit table. The OpenDriver function uses the following formula to determine a drivers unit number:
  1281. The unit table is a 256-byte nonrelocatable block of 64 four-byte spaces that contain handles to device control entries for installed drivers. If needed, the Device Manager automatically expands the unit table to a maximum of 128 entries. The global variable UTableBase contains the base address of the unit table. 
  1282. For an entry in the unit table to be suitable it must be empty—that is, contain a NIL pointer—and it must not be reserved. Table 2-1 shows a summary list of unit numbers reserved for specific purposes:
  1283.     Reserved unit numbers 
  1284.     Unit Number Range    RefNum Range    Purpose
  1285.     0 through 11    -1 through -12    Serial, Disk, AppleTalk, 
  1286.             Printer Drivers
  1287.     12 through 31    -13 through -32    Desk Accessories
  1288.     32 through 39    -33 through -40    SCSI Devices
  1289.     40 through 47    -41 through -48    Reserved 
  1290.     48 through 127    -49 through -128    Slot and Other Drivers
  1291. Listing 2-9 gives a high-level language function for searching the unit table for an appropriate location to install your driver. The driver-opening routine in the chapter “The Device Manager” calls this function and then uses the OpenDriver function to install and open the device driver.
  1292. Installing a driver
  1293.         FUNCTION FindEmptySpaceInUnitTable: Integer;
  1294.                 TYPE
  1295.                     WordPtr        = ^Integer;
  1296.     
  1297.                 CONST
  1298.                     UTableBase    = $11C;
  1299.                     UnitNtryCnt    = $1D2;
  1300.     
  1301.                 VAR
  1302.                     dRefNum        : Integer;
  1303.                     count        : Integer;
  1304.                     foundOne    : Boolean;
  1305.                     dce            : DCtlHandle;
  1306.  
  1307.                 BEGIN
  1308.                      {Get negative number of entries.}
  1309.                     count := - WordPtr(UnitNtryCnt)^;        
  1310.                     
  1311.                     dRefNum := -49;                    {first unreserved reference number}
  1312.     
  1313.                     foundOne := FALSE;
  1314.                     WHILE ( (dRefNum > count) AND NOT foundOne) DO
  1315.                         BEGIN
  1316.                             dce := GetDCtlEntry(dRefNum);
  1317.                             IF (dce = nil) THEN
  1318.                                 foundOne := TRUE
  1319.                             ELSE
  1320.                                 dRefNum := dRefNum - 1;
  1321.                         END;
  1322.     
  1323.                     IF (foundOne = FALSE) THEN
  1324.                         BEGIN
  1325.                             {make a larger table}
  1326.                         END;
  1327.  
  1328.                     FindEmptySpaceInUnitTable := -1 * (dRefNum + 1);
  1329.                 END;
  1330. Writing a Chooser-Compatible Device Driver
  1331. The Chooser is a desk accessory that helps provide a standard user interface for device drivers. It allows device drivers to prompt the user for choices such as which serial port to use, which AppleTalk zone to communicate with, and which LaserWriter to use.
  1332. If your device driver can serve different hardware devices or configurations, you may want to use the Chooser to provide an interface for the user to make choices.
  1333. You should read the previous section, “How the Device Manager Works,” which begins on page 2-3, before you read this section.
  1334. This section describes the Chooser, how it works, and how you can provide resources that set up a Chooser interface and respond to actions from the user.
  1335. How the Chooser Works
  1336. The Chooser allows users to select which devices they want to use. When the user launches the Chooser desk accessory, the Chooser displays the Chooser window, which contains lists and buttons for making device-related choices. Typically, users select a type of device from the icon list, then select the particular device they want to use from the device list. For AppleTalk devices, they must also select an AppleTalk zone from the zone list. The Chooser window can also display buttons, such as an OK button, and radio buttons, such as the LaserWriter’s background printing On and Off buttons.
  1337. Figure 1-4 shows an example Chooser window. 
  1338. The Chooser window
  1339. The Chooser relies heavily on the List Manager for creating, displaying, and manipulating possible user selections in this window. You may want to read the List Manager chapter in the Inside Macintosh: Toolbox volume for more information.
  1340. The Chooser does not communicate directly with device drivers; instead, it communicates with device packages. A device package is a resource similar to a driver resource, except a device package responds to Chooser messages instead of Device Manager requests. The device package is responsible for communicating the user’s choices to the device driver.
  1341. Device packages are stored in Chooser extension files, which the Chooser expects to find in the System Folder of the user’s startup disk. The Chooser extension file contains a number of resources in addition to the device package resource. These other resources allow you to specify information to the chooser. For example, you can specify
  1342. n    The device list box label. The Chooser displays this label over the device list.
  1343. n    Which buttons to use. The Chooser allows the device package to display up to four buttons, called the Left button, the Right button, the On radio button, and the Off radio button.
  1344. n    The titles and positions of the buttons.
  1345. n    The radio button label. 
  1346. n    The AppleTalk device type name. The Chooser searches the current AppleTalk zone for devices of this type.
  1347. n    An AppleTalk Name-Binding Protocol (NBP) retry interval and a timeout count. The Chooser uses this information when searching for AppleTalk devices.
  1348. When a user selects the icon corresponding to a particular device package, the Chooser sends messages to that device package by calling the device package as if it were the following function:
  1349. FUNCTION Package                                 (message, caller: Integer;
  1350.                                     objName, zoneName: StringPtr;
  1351.                                     p1, p2: LongInt) : OSErr;
  1352. Like the driver subroutine names, the name Package for the device package routine is a descriptive name. You can choose any name for your actual device package routine—the Chooser locates the routine using the device package header you provide. <36pt\>\x12 <8bat\>u
  1353. Parameter descriptions
  1354. message    Identifies the operation to be performed and has one of the following constant values:
  1355.             initMsg                                     = 11;                  {user selected this device package}
  1356.                     newSelMsg                 =     12;            {user made new device selections}
  1357.                     fillListMsg                 =     13;          {fill the device list with choices}
  1358.                     getSelMsg                 =    14;             {mark one or more choices selected}
  1359.                     selectMsg                 =     15;            {user made a selection}
  1360.                     deselectMsg                 =     16;      {user cancelled a selection}
  1361.                     terminateMsg                 =     17;         {allows device package to clean up}
  1362.                     buttonMsg                 =     18;            {user selected a button}
  1363.     The section “Responding to the Chooser” on page 2-27 explains these messages in more detail.
  1364. caller    Identifies the caller. A value of 1 indicates the Chooser. Values in the range 0 to 127 are reserved; values outside this range may be used by applications.
  1365. zoneName    Contains name of AppleTalk zone containing the devices in the device list. If the Chooser is being used with the local zone and bit 24 of the flags field of the device package header is not set, the string value is '*'; otherwise, it’s the actual zone name. See the section “Creating a Device Package” on page 2-26 for more information about the package header.
  1366. p1    Contains a handle to the List Manager list that contains the device choices displayed in the device list box. 
  1367. objName    Contains other information. The meaning of this parameter depends on the value of the message parameter. See “Responding to the Chooser” on page 2-27 for more information
  1368. p2     Contains other information. The meaning of this parameter depends on the value of the message parameter. See “Responding to the Chooser” on page 2-27 for more information
  1369. When the user opens the Chooser, the Chooser searches the Extensions folder in the System Folder of the startup disk for Chooser extension files. For each one it finds, it opens the file, fetches the device’s icon, fetches the flags field from the device package header, and closes the file. The Chooser then displays each device’s icon, graying the icons for AppleTalk devices if AppleTalk is not connected.
  1370. When the user selects a device package icon that is not grayed, the Chooser reopens the corresponding Chooser extension file and does the following:
  1371.     1.    The Chooser labels the device list box with the device list box label.
  1372.     2.    The Chooser sends the init message to the selected device package. 
  1373.     3.    If the selected device package represents a serial printer, the Chooser places in the device list box the two icons that represent the printer port and the modem port serial drivers. When the user makes a selection, the Chooser records the user’s choice in low memory and parameter RAM.
  1374.     4.    If the selected device package represents an AppleTalk device and does not accept fillList messages, the Chooser initiates an asynchronous routine that interrogates the current AppleTalk zone for all devices whose type matches the AppleTalk device type name specified in the Chooser extension file. The asynchronous routine uses the retry interval and the timeout count. As responses arrive, the Chooser updates the device list box.
  1375.     5.     If the selected device package does accept fillList messages, the Chooser sends the fillList message to the device package. The device package responds by filling the device list with the appropriate device choices.
  1376.     6.    To determine which entries in the device list should be selected, the Chooser calls the device package with the getSel message. The device package responds by inspecting the list and setting the selected or unselected state of each entry. The Chooser may send the getSel message frequently; for example, each time a new response to the AppleTalk zone interrogation arrives. The Chooser does not send the getSel message for serial printers; it highlights the icon corresponding to the currently-selected serial port, as recorded in low memory.
  1377.     7.    If the device package allows multiple devices to be active at once, the Chooser sets the appropriate List Manager bits. When the user selects or deselects a device, the Chooser calls the device package with the appropriate message. For packages that do not accept multiple active devices, the Chooser sends the select or deselect message; otherwise, it sends the newSel message. The device package mounts or unmounts the device, if appropriate, and records the user choice.
  1378.     8.    When the user chooses a different device type or closes the Chooser, the Chooser calls the current device package with the terminate message, if the package accepts this kind of message. At this time, the package can clean up, if necessary. The Chooser then calls the UpdateResFile procedure, closes the device resource file, and flushes the system startup volume.
  1379. Creating a Chooser Extension File
  1380. The Chooser accepts three types of Chooser extension files to identify different kinds of devices:
  1381.     File type    Device type        
  1382.     'PRES'    Serial printer
  1383.     'PRER'    Non-serial printer
  1384.     'RDEV'    Other device
  1385.              
  1386. You can specify the creator of your device resource file, which allows you to give your device its own icon.
  1387. You can include these resources in your device package file:
  1388.     Resource Type and ID    Description        
  1389.     'PACK'    –4096    Device package. This resource contains the device
  1390.             package header and code.
  1391.     'STR '    –4096    Type name for AppleTalk devices. The Chooser searches 
  1392.             the current Appletalk zone for devices of this type.
  1393.     'GNRL'    –4096    Appletalk information. The first byte of this resource
  1394.             contains the Name-Binding Protocol (NBP) retry interval,
  1395.              the second byte contains the timeout count.
  1396.     'STR '    –4091    List box label. The Chooser labels the device list with this
  1397.             string after the user has selected the device’s icon.
  1398.     'STR '    –4087    Radio button label.
  1399.     'STR '    –4088    Off radio button title.
  1400.     'STR '    –4089    On radio button title.
  1401.     'STR '    –4092    Right button title.
  1402.     'STR '    –4093    Left button title.
  1403.     'ncrt'    –4096    Button positions.
  1404.     'LDEF'    –4096    Alternate list definition procedure. You can supply this
  1405.             procedure to modify the device list—to include pictures
  1406.              or icons, for example.
  1407.     'STR '    –4090    Reserved for use by the Chooser.
  1408. You should also include a 'BNDL' resource to give your device type a distinctive icon, because this may be the only way that devices are identified in the Chooser window. The Finder Interface chapter describes the 'BNDL' resource.
  1409. The next section, “Creating a Device Package,” discusses the device package resource in more detail, and the section “How the Chooser Works” on page 2-21 describes how the Chooser uses the fields related to AppleTalk.
  1410. The Chooser window allows your device package to display two buttons, called the Left button and the Right button because of their default positions. The left button has a double border and is highlighted (the title string is dark, not gray) when one or more devices are selected from the device list. When this button is highlighted, pressing Return or Enter, or double-clicking in the device list are equivalent to clicking the button. The right button has a single border and is always highlighted, and the user can activate it only by clicking it.
  1411. The Chooser also allows you to display two radio buttons and a radio button label. These buttons are called the On radio button and the Off radio button because those are the titles the LaserWriter uses, but you can give them whatever titles you want.
  1412. You can position these buttons by including a resource of type 'ncrt' with an ID of –4096. The first word in this type of resource specifies the number of rectangles, and the rest of the resource contains the rectangle definitions. The first rectangle positions the left button, the second positions the right button, the third positions the On radio button, and the fourth positions the Off radio button. The fifth rectangle positions the radio button label.
  1413. Each rectangle definition is 8 bytes long and contains the rectangle coordinates in the order [top, left, bottom, right]. The default values are [112, 206, 132, 266] for the left button and [112, 296, 132, 356] for the right button. You could use the values [112, 251, 132, 331] to center a single button.
  1414. The Chooser uses the List Manager to produce and display the standard device list. You can supply a list definition procedure to modify this list. For example, you might want to include pictures or icons in your list. To do this, you must provide a resource of type 'LDEF' with an ID of –4096. See the List Manager chapter in the Inside Macintosh: Macintosh Toolbox volume for the mechanics of list construction and for the list data structure.
  1415. Creating a Device Package
  1416. Like a driver resource, a device package has two parts:
  1417. n    the package header that contains some flags and some other data about the driver
  1418. n        the package code that responds to Chooser messages
  1419. The package header contains a few words of flags and other data and a branch instruction to the package’s Device routine. Figure 2-3 shows the format of a package header.
  1420. The format of a package header
  1421. Since the Chooser expects the Package routine to be at the beginning of the device package, the first field of the package header should be a BRA.S instruction to the package code.
  1422. The device ID is an integer that identifies the device. The version word differentiates versions of the driver code.
  1423. The package code should implement the Package function. The section “How the Chooser Works” on page 2-21 gives the interface for this function. The next section, “Responding to the Chooser,” discusses how to implement this function.
  1424. The flags field contains information about the device and the device package. Table 2-2 lists the meaning of each bit of the flag word.
  1425. Device package flags
  1426.     Bit    Meaning
  1427.     31    Set if an AppleTalk device
  1428.     30–29    Reserved (clear to 0)
  1429.     28    Set if the device package can have multiple instances selected     at once
  1430.     27    Set if the device package uses the Left button
  1431.     26    Set if the device package uses the Right button
  1432.     25    Set if no zone name has been saved
  1433.     24    Set if device package uses actual zone names
  1434.     23–21    Reserved (clear to 0)
  1435.     20    Set if device uses the On and Off radio buttons and radio button label
  1436.     19–17    Reserved (clear to 0)
  1437.     17    Set if device package accepts the init message
  1438.     16    Set if device package accepts the newSel message
  1439.     15    Set if device package accepts the fillList message
  1440.     14    Set if device package accepts the getSel message
  1441.     13    Set if device package accepts the select message
  1442.     12    Set if device package accepts the deselect message
  1443.     11    Set if device package accepts the terminate message
  1444.     10–0    Reserved (clear to 0)
  1445.     
  1446. Responding to the Chooser 
  1447. This section gives more details about how your device package should respond when it receives a message from the Chooser.
  1448. When the Chooser sends your device package a message, the Chooser extension file is the current resource file, the Chooser window is the current grafPort, and the System Folder of the current startup disk is the default volume. Your device package must preserve all of these.
  1449. Table 2-3 lists the Chooser messages and how your package should respond to them. 
  1450. Chooser messages and their meanings
  1451.     Message    Meaning
  1452.     init    The Chooser sends this message to your package when the user selects the icon representing your package in the icon list. The objName parameter contains a pointer to a data structure that contains a size word followed by four handles to ControlRecord data structures. The size is at least 18 bytes (2 bytes for the size word and 4 bytes for each of the handles). The handles reference the Left and Right buttons and the On and Off radio buttons in that order. Your package can respond to this message by setting up the initial button configuration. To display one of the radio buttons, you must call the ShowControl routine for it. To highlight them, you must call the SetCtlValue routine. See the chapter “The Control Manager” for more information. The p2 parameter is not used.
  1453.     newSel    If your device package allows multiple selections, the Chooser sends this message to your packages when the user changes or adds a selection. The objName and p2 parameters are not used.
  1454.     fillList    The Chooser sends this message when the user selects a device icon. The p1 parameter contains a handle to a List Manager list. Your device package should use the List Manager to fill this list with choices for the particular device. The objName and p2 parameters are not used.
  1455.     getSel    The Chooser sends this message to determine which entries should be selected. The p1 parameter contains a handle to a List Manager list. Your device package should respond by inspecting the list and setting the selected or unselected state of each entry, using the LSetSelect function. You should alter only the entries that require updating. The Chooser does not send this message for serial printers. 
  1456.     select    If your device package does not allow multiple selections, the Chooser sends this message to your packages when the user selects a device from the device list. You should record the user’s selection, preferably in your Chooser extension file. Your device package may not call the List Manager in response to this message.
  1457.         If your package accepts fillList messages, the objName parameter is undefined and the p2 parameter gives the row number of the selected device.
  1458.         If your package does not accept fillList messages, the objName parameter contains a pointer to a string of up to 32 characters that contains the name of the device. If the device is an Appletalk device, the p2 parameter gives the AddrBlock value for the address of the selected AppleTalk device. (See the chapter “AppleTalk” for more information.)
  1459.     deselect    If your device package does not allow multiple selections, the Chooser sends this message to your packages when the user deselects a device in the device list. Your device package may not call the List Manager in response to this message.
  1460.         If your package accepts fillList messages, the objName parameter is undefined and the p2 parameter gives the row number of the selected device.
  1461.         If your package does not accept fillList messages, the objName parameter contains a pointer to a string (of up to 32 characters) containing the name of the device. If the device is an Appletalk device, the p2 parameter gives the AddrBlock value for the address of the selected AppleTalk device. (See the chapter “AppleTalk” for more information.)
  1462.     terminate    The Chooser sends this message when the user selects a different device icon, closes the Chooser window, or changes zones. Your device package should perform any necessary clean-up tasks, but should not dispose of the device list. The objName and p2 parameters are not used.
  1463.     button    The Chooser sends this message when the user clicks one of the buttons in the Chooser window. The low-order byte of the p2 parameter contains 1 if the user clicked the Left button, 2 if the user clicked the Right button, 3 if the user clicked the On radio button, and 4 if the user clicked the Off radio button. You must perform the appropriate highlighting for the radio buttons. The high-order word of this parameter contains the modifier bits from the mouse up event. See the chapters “The Control Manager” and “The Event Manager” for more information.
  1464. Allocating private storage
  1465. Device packages initially have no data space allocated. There are two ways your package can acquire data space:
  1466. n    Use the List Manager to allocate extra memory in the device list.
  1467. n    Create a resource.
  1468. The Chooser uses column 0 of the device list to store the names displayed in the list box; for device packages that do not accept fillList messages, it uses column 1 to store the 4-byte AppleTalk internet addresses of the devices in the list. Therefore, your device package can use column 1 and higher (if it accepts fillList messages) or column 2 and higher to store private data. You can use standard List Manager routines to add these columns, store data in them, and retrieve the data stored there. Your device package can also use the refCon field of the device list for its own purposes.
  1469. Using the device list is limited by the fact that the Chooser disposes of the device list whenever the user changes device types or changes the current zone. However, the Chooser does call your device package with the terminate message before it disposes of the list.
  1470. Also, if your device package does not accept fillList messages, the Chooser disposes of the device list whenever a new response from the AppleTalk zone interrogation arrives. However, the Chooser does call the getSel message immediately afterwards.
  1471. The second way to get storage space is to create a resource in the device resource file. This file is always the current resource file when the Chooser sends a message to the package, so you can use the GetResource routine to obtain a handle to the storage.
  1472. It is important for most device packages to record which devices the user has chosen. To do this, the recommended method is to create a resource in your driver resource file. This resource can be of any type; in fact, it’s advantageous to provide your own resource type so that no other program will try to modify it. If you choose to use a standard resource type, you should use only resource IDs in the range –4080 through –4065.
  1473. Writing a Desk Accessory
  1474. Desk accessories are device drivers that act like small applications. Desk accessories typically provide a user interface with a window and a menu, perform some limited function, and are opened from the Apple menu. The Chooser is an example of a desk accessory.
  1475. Desk accessories were originally designed for the Macintosh environment because they offered two distinct advantages over applications. They offered both a limited degree of multitasking and a primitive form of interprocess communication. However, applications under the system software version 7.0 environment enjoy far more sophisticated versions of these capabilities. Users can even open applications from the Apple menu. For these reasons, you would be better served by writing a small application than by writing a desk accessory. 
  1476. If you’re certain you need to write a desk accessory, you should read this section. You might want to read the chapters about the Event Manager, the Window Manager, the Dialog Manager, and the Menu Manager in the Inside Macintosh: Macintosh Toolbox volume as well.
  1477. How Desk Accessories Work
  1478. In system software version 7.0 environment, when the user opens a desk accessory (or when an application calls the Menu Manager routine OpenDeskAcc) the system switches out the current application, loads the desk accessory into the system heap, and calls the desk accessory’s Open driver subroutine. The desk accessory can respond by creating its window and menu. 
  1479. When events occur, the Event Manager directs them to the desk accessory by calling its Control driver subroutine. The Event Manager handles switching between applications and the desk accessories in the system heap and passing along the events meant for the desk accessory. The desk accessory need only respond to the Control request.
  1480. When the user closes the desk accessory (by closing its window or choosing Quit from its menu) or an application closes the desk accessory (by calling the Menu Manager routine CloseDeskAcc), the desk accessory disposes of its window (if any) and any other data structures associated with it.
  1481. In a single-application environment in system software version 6.0 or in multiple-application environment where the desk accessory is opened in the application’s partition (for example, when the user holds the Option key while opening the desk accessory from the Apple menu), the Event Manager handles events for desk accessories in a slightly different manner, although it still translates them into Control requests. See the chapter “The Event Manager” in the Inside Macintosh: Macintosh Toolbox volume for details.
  1482.  
  1483. Creating a Driver Resource for a Desk Accessory
  1484. To create a desk accessory, you must create it as a driver resource and include it in a resource file, as described in “Creating a Driver Resource” on page 2-5. Typically, you store your desk accessory driver resource in a desk accessory file, which allows you to include a 'BNDL' resource to give your desk accessory an icon, and the user stores your desk accessory file in the Apple Menu Items folder. 
  1485. In addition to the driver header fields important for all drivers, described in “Creating a Driver Resource,” three fields are of particular importance to desk accessories:
  1486. n    The drvrEMask field. This field contains an event masks specifying which events your desk accessory can handle. If your desk accessory has a window, you should include keyboard, activate, update, and mouse-down events, but you should not include mouse-up events. When an event occurs, the Event Manager checks this field to determine whether the desk accessory can handle the type of event, and if so, calls the desk accessory’s Control subroutine. See the chapter “The Event Manager” in the Inside Macintosh: Macintosh Toolbox for more information about events and event masks.
  1487. n    The drvrMenu field. This field contains the menu ID of your desk accessory’s menu, if it has one, or any one of its menus, if it has more than one. Otherwise, it contains 0. The menu ID for a desk accessory’s menu must be negative and must be distinct from the menu ID for other desk accessories.
  1488. n    The drvrDelay field and the dNeedTime flag of the drvrFlags field. Desk accessories often need to perform predefined actions periodically. For example, a clock desk accessory may want to change the time it displays every second. If your desk accessory needs to perform a periodic action, set the dNeedTime flag and use the drvrDelay field to indicate how often the action should occur. The section “Creating a Driver Resource” describes these fields in more detail.
  1489. Of the five possible driver subroutines, your desk accessory needs to implement three: Open, Close, and Control. You can implement a Prime and Status subroutine if needed.
  1490. Opening and Closing a Desk Accessory
  1491. In your desk accessory’s Open subroutine, you should:
  1492. n    Create the desk accessory’s window. You can do this with the Dialog Manager function GetNewDialog or NewDialog. You should specify that the window be invisible because the OpenDeskAcc routine will display it. You should set the windowKind field of the window’s windowRecord data structure to the desk accessory’s driver reference number, which you can find in the device control entry. You should also store a copy of the window pointer in the dCtlWindow field of the device control entry.
  1493. n    Allocate private storage as you would for any device driver.
  1494. n    Create a menu or menus if needed for your desk accessory. You are responsible for adding your menu to the menu bar. See the chapter “The Menu Manager” in the Inside Macintosh: Macintosh Toolbox volume for more details.
  1495. If your Open subroutine is unable to complete its tasks (by running out of memory, for example), you should open only the minimum data structures possible, modify the code so it doesn’t respond to events, and display an alert indicating failure.
  1496. As for all drivers, your Close subroutine should undo the actions taken by the Open subroutine, disposing of the window and private storage, clearing the window pointer in the device control entry, and removing the menu from the menu bar.
  1497. Responding to Events
  1498. When the Event Manager determines an event has occurred that your desk accessory should handle, it checks the drvrEMask field of the driver header and, if that field indicates your driver handles the event type, it passes the event to your driver by means of your Control subroutine.
  1499. The Event Manager passes one of nine values in the csCode field to indicate the action to take:
  1500. Constant name    Value    Meaning             
  1501. accEvent    64    Handle a given event
  1502. accRun    65    Time for periodic action
  1503. accCursor    66    Change cursor shape if appropriate
  1504. accMenu    67    Handle a given menu item
  1505. accUndo    68    Handle the Undo command
  1506. accCut    70    Handle the Cut command
  1507. accCopy    71    Handle the Copy command
  1508. accPaste    72    Handle the Paste command
  1509. accClear    73    Handle the Clear command
  1510. Along with the accEvent message, the Event Manager sends a pointer to an event record in the csParam field. You can respond to the event in whatever way is appropriate. For example, when your desk accessory becomes active you might install its menu in the menu bar. 
  1511. If your desk accessory’s window is a modeless dialog box and you are calling the Dialog Manager routine IsDialogEvent in response to the event, you should set the windowKind field of your window record to 2 before you call the IsDialogEvent routine. Setting this field to 2 allows the Dialog Manager to recognize and handle the event properly. You should restore the original value of the windowKind field before returning from your Control subroutine.
  1512. The accCursor message makes it possible to change the shape of the cursor when its inside your desk accessory window and your desk accessory window is active. Your control routine should check whether the mouse location is in your window; if it is, you should set the cursor to the whatever cursor you desire by calling the QuickDraw routine InitCursor. 
  1513. If your desk accessory window is a dialog box, you should respond to the accCursor message by generating a null event (storing the event code for a null event in an event record) and passing it to the Dialog Manager routine DialogSelect. This enables the Dialog Manager to blink the caret in editText items. 
  1514. When the Event Manager sends the accMenu message, it provides the menu ID followed by the menu item number in the csParam field. You should take the appropriate action and then call the Menu Manager routine HiliteMenu with a value of 0 for the menuID parameter to remove the highlighting from the menu bar.
  1515. You should respond to the last five messages—accUndo through accClear—by processing the corresponding editing command in the desk accessory window, if appropriate. The chapter “The Scrap Manager” contains information about cutting and pasting.
  1516. Your desk accessory routines should restore the current resource file and the current grafPort if it changes either one.
  1517. Reference
  1518. This section describes the Device Manager routines, including the routines that allow your application to communicate with existing device drivers and the routines that provide support for your own device driver. This sections ends with a description of the 'DRVR' resource type.
  1519. Data Structures
  1520. The device control entry
  1521.             TYPE DCtlEntry = 
  1522.                   RECORD
  1523.                     dCtlDriver:                  Ptr;                {pointer or handle to driver                                        }
  1524.                     dCtlFlags:                  Integer;               {flags            }
  1525.                     dCtlQHdr:                  QHdr;                {driver request queue header                                        }
  1526.                     dCtlPosition:                 LongInt;               {byte position}
  1527.                     dCtlStorage:                  Handle;                {handle private storage}
  1528.                     dCtlRefNum:                  Integer;               {driver reference number                    }
  1529.                     dCtlCurTicks:                 LongInt;               {used internally                        }
  1530.                     dCtlWindow:                  WindowPtr;             {pointer to desk accessory window                                                    }
  1531.                     dCtlDelay:                  Integer;               {ticks between periodic actions                                                    }
  1532.                     dCtlEMask:                  Integer;               {event mask for desk accessories                                                    }
  1533.                     dCtlMenu:                  Integer;               {menu ID for desk accessories                                                    }
  1534.                    END;
  1535. dCtlDriver    Contains a pointer or a handle to the driver, as determined by bit 6 of the dCtlFlags field.
  1536. dCtlFlags    Contains flags about the abilities and state of the driver. The low-order byte contains these flags: 
  1537.     Bit        Meaning
  1538.     5    Set if driver is open.
  1539.     6    Set if driver is RAM-based, that is, if 
  1540.             the dCtlDriver field contains a handle.
  1541.     7    Set if driver is currently executing.
  1542.     The high-order byte contains flags     copied from the drvrFlags word of the driver resource. See “Creating a Driver Resource” on page 2-5 for more information.
  1543. dCtlQHdr    Contains the header of the driver request queue, which is a standard Operating System queue. See the chapter “Operating System Utilities” in the Inside Macintosh: Operating System volume for more information about the QHdr data type.
  1544. dCtlPostion    Indicates the current source or destination position for reading or writing. This field is only used by drivers of block devices. The value in this field is the number of bytes beyond the physical beginning of the medium used by the device. For example, immediately after the Disk Driver reads the first block of data from a 3.5-inch disk, this field contains the value 512.
  1545. dCtlStorage    Contains a handle to a driver’s private storage. A driver may allocate a relocatable block of memory and keep a handle to it in this field.
  1546. dCtlRefNum    Contains the driver reference number.
  1547. dCtlCurTicks    Used internally.
  1548. dCtlWindow    Contains a pointer to the desk accessory window. See “Reference” on page 2-34 for more information.
  1549. dCtlDelay    Indicates the number of ticks to wait between periodic actions.
  1550. dCtlEMask    Contains the desk accessory event mask. See “Reference” on page 2-34 for more information.
  1551. dCtlMenu    Contains the menu ID of a desk accessory’s menu, if any. See “Reference” on page 2-34 for more information.
  1552. The Extended Device Control Entry
  1553. The device control entry for drivers that serve slot devices needs to store some additional information: the slot number, the slot resource ID, the device base address, and the external device ID. The extended device control entry, defined by the AuxDCE data type in “The extended device control entry” on page 2-35, contains additional fields to store these values.
  1554. The extended device control entry
  1555. TYPE AuxDCE= 
  1556.    RECORD
  1557.                     dCtlDriver:                  Ptr;                {pointer or handle to driver                                        }
  1558.                     dCtlFlags:                  Integer;               {flags            }
  1559.                     dCtlQHdr:                  QHdr;                {driver request queue header                                        }
  1560.                     dCtlPosition:                 LongInt;               {byte position}
  1561.                     dCtlStorage:                  Handle;                {handle private storage}
  1562.                     dCtlRefNum:                  Integer;               {driver reference number                    }
  1563.                     dCtlCurTicks:                 LongInt;               {used internally                        }
  1564.                     dCtlWindow:                  WindowPtr;             {pointer to desk accessory window                                                    }
  1565.                     dCtlDelay:                  Integer;               {ticks between periodic actions                                                    }
  1566.                     dCtlEMask:                  Integer;               {event mask for desk accessories                                                    }
  1567.                     dCtlMenu:                  Integer;               {menu ID for desk accessories                                                    }
  1568.                     dCtlSlot:                  Integer;                 {slot        }
  1569.                     dCtlSlotId                  Integer;                 {slot ID            }
  1570.                     dCtlDevVBase:                 Integer;                 {base address of card for driver                                                    }
  1571.                     reserved:                  Integer;                 {reserved; should be 0                            }
  1572.                     dCtlExtDev:                  Integer;                 {external device ID                        }
  1573.                     fillByte:                  Integer;                 {reserved            }
  1574.    END;
  1575. The first eleven fields of the extended device control entry are identical to the fields of the device control entry, described in the previous section.
  1576. dCtlSlot    Contains the slot number. 
  1577. dCtlSlotId    Contains the RsrcDirID for the slot resource.
  1578. dCtlDevBase    Points to the device base address.
  1579. dCtlExtDev    Contains the external device ID.
  1580. The chapter “The Slot Manager” in this book contains detailed information about these values. 
  1581. Routines
  1582. The Device Manager provides a number of routines that provide low-level support for your own driver subroutines.
  1583. The GetDCtlEntry function allows your driver to obtain a handle to its device control entry. 
  1584. The IODone routine allows your driver to notify the Device Manager that a request is complete. The Fetch and Stash routines allow your driver move characters into and out of data buffers. You pass a pointer to the device control entry in the A1 register to each of these three routines. The Device Manager uses the device control entry to locate the active request. If no such request exists, these routines generates system error dsIOCoreErr.
  1585. In the interest of speed, you invoke the Fetch, Stash, and IODone routines with jump vectors, stored in the global variables JFetch, JStash, and JIODone, rather than macros. You use a jump vector by moving its address onto the stack. An example is:
  1586. MOVE.L                        JIODone,-(SP)
  1587. RTS
  1588. The Fetch and Stash routines do not return a result code; if an error occurs, the System Error Handler is invoked. 
  1589. 2GetDCtlEntry
  1590. You can use the GetDCtlEntry function to obtain a handle to the device control entry of a device driver.
  1591. FUNCTION GetDCtrlEntry                                         (refNum: Integer) : DCtlHandle;
  1592. refNum    Contains the reference number of the driver.
  1593. DESCRIPTION
  1594. The GetDCtlEntry function returns a handle to the device control entry of the device driver indicated by the refNum parameter.
  1595. 2Fetch
  1596. You can use the Fetch routine to get the next character from the data buffer.
  1597. DESCRIPTION
  1598. The Fetch routine gets the next character from the data buffer pointed to by the ioBuffer field of the parameter block of the pending request. It increments the ioActCount field by 1. If the ioActCount field equals the ioReqCount field, this function sets bit 15 of register D0. After receiving the last byte request, the driver should call the IODone routine.
  1599. Registers on entry
  1600. A1    pointer to the device control entry
  1601. Registers on exit
  1602. D0    character fetched; bit 15 = 1 if it’s the last character in the buffer
  1603. Jump vector    
  1604. JFetch
  1605.     
  1606. 2    Stash
  1607. You can use the Stash routine to store the next character from the data buffer.
  1608. DESCRIPTION
  1609. The Stash routine places the character in register D0 into the data buffer pointed to by the ioBuffer field of the parameter block of the pending request and increments the ioActCount field by 1. If the ioActCount field equals the ioReqCount field, this function sets bit 15 of register D0. After stashing the last byte requested, the driver should call the IODone routine.
  1610. ASSEMBLY-LANGUAGE INFORMATION
  1611. Registers on entry
  1612. A1    pointer to DCE
  1613. D0    character to stash
  1614. Registers on exit
  1615. D0    bit 15 = 1 if it’s the last character in the buffer
  1616. Jump vector    
  1617. JStash
  1618. 2IODone
  1619. You can use the IODone routine to notify the Device Manager that the current request has been satisfied.
  1620. DESCRIPTION
  1621. The IODone routine removes the current request from the driver request queue, marks the driver inactive, unlocks the driver and its device control entry (if allowed by the dNeedLock bit of the dCtlFlags word), and executes the completion routine if any. Then the Device Manager begins the next request in the driver request queue.
  1622. The section “Responding to the Device Manager” on page 2-9 explains in detail when to use this routine.
  1623. ASSEMBLY-LANGUAGE INFORMATION
  1624. Registers on entry
  1625. A1     pointer to DCE
  1626. D0     result code
  1627. Jump vector    
  1628. JIODone    
  1629. SEE ALSO
  1630. For an example of the IODone routine, see “Responding to the Device Manager” on page 2-9.
  1631. Resources
  1632. This section describes the driver resource, which you should use to store your device drivers and desk accessories. Listing 2-12 shows the Rez format of the 'DRVR' resource type. The driver resource has type 'DRVR'.
  1633.  'DRVR' resource format
  1634. type 'DRVR' {
  1635.     boolean = 0;
  1636.     boolean            dontNeedLock, needLock;                                        /* lock drvr in memory */
  1637.     boolean            dontNeedTime, needTime;                                        /* for periodic action */
  1638.     boolean            dontNeedGoodbye, needGoodbye;                                        /* call before heap reinit */
  1639.     boolean            noStatusEnable, statusEnable;                                        /* responds to Status */
  1640.     boolean            noCtlEnable, ctlEnable;                                        /* responds to Control */
  1641.     boolean            noWriteEnable, writeEnable;                                        /* responds to Write */
  1642.     boolean            noReadEnable, readEnable;                                        /* responds to Read */
  1643.     byte = 0;
  1644.     integer;                                                    /* driver delay */
  1645.     unsigned hex integer;                                                    /* DA event mask */
  1646.     integer;                                                    /* DA menu */
  1647.     unsigned hex integer;                                                    /* offset to Open */
  1648.     unsigned hex integer;                                                    /* offset to Prime */
  1649.     unsigned hex integer;                                                    /* offset to Control*/
  1650.     unsigned hex integer;                                                    /* offset to Status */
  1651.     unsigned hex integer;                                                    /* offset to Close */
  1652.     pstring;                                                     /* driver name */
  1653.     hex string;                                                    /* driver code */
  1654. };
  1655. The driver resource begins with seven flags that specify certain characteristics of the driver. 
  1656. You need to set the dNeedLock flag if your driver’s code should be locked in memory. 
  1657. You set the dNeedTime flag of the drvrFlags word if your device driver needs to perform some action periodically. 
  1658. You need to set the dNeedGoodbye flag if you want your application to receive a goodBye Control request before the heap is reinitialized.
  1659. The last four flags indicate which Device Manager requests the driver’s routines can respond to.
  1660. The next element of the resource specifies the time between periodic tasks.
  1661. The next two elements provide an event mask and menu ID for desk accessories. The section “Writing a Desk Accessory” on page 2-31 describes these fields.
  1662. Offsets to the driver routines follow the desk accessory fields. See the section “Entering and Exiting From Driver Subroutines” on page 2-9 for more information about the subroutine offsets.
  1663. The next element of the driver resource is the driver name. You can use uppercase and lowercase letters when naming your driver, but the first character should be a period—.YourDriver, for example.
  1664. Your driver routines, which follow the driver name, must be aligned on a word boundary.
  1665. The section “Creating a Driver Resource” on page 2-5 discusses this structure in detail.
  1666. Summary
  1667. This section lists the declarations and definitions from this chapter. You might want to supplement this information with the information in the summary section of the chapter “The Device Manager,” in this book.
  1668. Constants
  1669. {Chooser messages}
  1670. CONST initMsg                        =    11;        {the user selected this device package}
  1671.      newSelMsg                    =    12;        {the user made new device selections}
  1672.      fillListMsg                    =    13;        {fill the device list with choices}
  1673.      getSelMsg                     =    14;        {mark one or more choices as selected}
  1674.      selectMsg                     =    15;        {the user made a selection}
  1675.      deselectMsg                     =    16;        {the user cancelled a selection}
  1676.      terminateMsg                     =    17;        {allows device package to clean up}
  1677.      buttonMsg                     =    18;        {the user selected a button}
  1678. Data Types
  1679. TYPE DCtlEntry = 
  1680.        RECORD
  1681.         dCtlDriver:                    Ptr;                { pointer or handle to driver                                                    }
  1682.         dCtlFlags:                    Integer;                { flags                                                    }
  1683.         dCtlQHdr:                    QHdr;                { driver request queue header                                                    }
  1684.         dCtlPosition:                    LongInt;                { byte position used by I/O operations                                                    }
  1685.         dCtlStorage:                    Handle;                { handle to driver’s private storage                                                    }
  1686.         dCtlRefNum:                    Integer;                { driver reference number                                                    }
  1687.         dCtlCurTicks:                    LongInt;                { used internally                                                    }
  1688.         dCtlWindow:                    WindowPtr;                { pointer top driver’s window                                                    }
  1689.         dCtlDelay:                    Integer;                { ticks between periodic actions                                                    }
  1690.         dCtlEMask:                    Integer;                { event mask (for desk accessories)                                                    }
  1691.         dCtlMenu:                    Integer;                { menu ID (for desk accessories)                                                    }
  1692.        END;
  1693.       DCTlPtr                         =    ^DCtlEntry;
  1694.       DCtlHandle                        =    ^DCtlPtr;
  1695.  
  1696.     AuxDCE= 
  1697.       RECORD
  1698.         dCtlDriver:                    Ptr;                {pointer or handle to driver    }
  1699.         dCtlFlags:                    Integer;                {flags        }
  1700.         dCtlQHdr:                    QHdr;                {driver request queue header}
  1701.         dCtlPosition:                    LongInt;                {byte position used by I/O operations                                                    }
  1702.         dCtlStorage:                    Handle;                {handle to driver’s private storage                                        }
  1703.         dCtlRefNum:                    Integer;                {driver reference number                                }
  1704.         dCtlCurTicks:                    LongInt;                {used internally                    }
  1705.         dCtlWindow:                    WindowPtr;                {pointer top driver’s window                                    }
  1706.         dCtlDelay:                    Integer;                {ticks between periodic actions                                        }
  1707.         dCtlEMask:                    Integer;                {event mask (for desk accessories)                                            }
  1708.         dCtlMenu:                    Integer;                {menu ID (for desk accessories)                                        }
  1709.         dCtlSlot:                    Integer;                {slot    }
  1710.         dCtlSlotId                    Integer;                {slot ID        }
  1711.         dCtlDevVBase:                    Integer;                {base address of card for driver                                        }
  1712.         reserved:                    Integer;                {reserved; should be 0                            }
  1713.         dCtlExtDev:                    Integer;                {external device ID                        }
  1714.         fillByte:                    Integer;                {reserved            }
  1715.        END;
  1716.        AuxDCEPtr                         =    ^AuxDCE;
  1717.       AuxDCEHandle                        =    ^AuxDCEPtr;
  1718.  
  1719. Routines
  1720. Driver Support Routines
  1721. FUNCTION GetDCtrlEntry                                         (refNum: Integer) : DCtlHandle;
  1722. Assembly-Language Information
  1723. Routines Requiring Jump Vectors
  1724. Routine    Jump Vector
  1725. Fetch    JFetch
  1726. Stash    JStash
  1727. IODone    JIODone
  1728. The Slot Manager
  1729. Introduction to Slots and Cards3-3
  1730. Address allocations3-5
  1731. Firmware3-7
  1732. The format block3-7
  1733. The sResource directory3-8
  1734. sResource Data Structures3-8
  1735. sResource Types and sResource Names3-10
  1736. The Board sResource3-11
  1737. About the Slot Manager3-12
  1738. Using the Slot Manager3-14
  1739. Enabling and Disabling NuBus Cards3-14
  1740. Deleting and Restoring sResource Data Structures3-15
  1741. Enabling and Disabling sResource Data Structures3-15
  1742. Searching for sResource Data Structures3-16
  1743. Getting Information from sResource Data Structures3-18
  1744. Reference to the Slot Manager3-20
  1745. Data Structures3-20
  1746. Determining the Version of the Slot Manager3-22
  1747. Finding sResource Data Structures3-24
  1748. Enabling, Disabling, Deleting, and Restoring sResource
  1749. Data Structures3-35
  1750. Getting Information from sResource Data Structures3-40
  1751. Loading Drivers and Executing Code from sResource 
  1752. Data Structures3-53
  1753. Traversing Firmware of Expansion Cards3-57
  1754. Getting Information about Expansion Cards and 
  1755. Declaration ROMs3-58
  1756. Getting Access to Expansion Cards’ Parameter RAM3-65
  1757. Summary of the Slot Manager3-69
  1758. 3The Slot Manager
  1759. This chapter describes how your application or device driver can use the Slot Manager to identify expansion cards and communicate with the firmware on each card.
  1760. You need to use the Slot Manager only if you are writing an application or a device driver that must address an expansion card directly. For example, you need to use the Slot Manager if you are writing a driver for a video card, but not if you only want to display information on a monitor for which a device driver already exists.
  1761. The Slot Manager provides routines to help you search through the data structures that expansion cards use to organize the information in their firmware. The meaning of the information in the data structures varies from card to card; you need to know the specifics of a card in order to interpret its data structures. 
  1762. This chapter provides a brief introduction to Apple’s implementation of NuBus and expansion cards. This introduction explains the firmware data structures, but does not give much detail about the information these data structures contain. To interpret these data structures, you need to know the information in Designing Cards and Drivers for the Macintosh Family, as well as information specific to the card you’re examining.
  1763. If you are designing an expansion card, you must read Designing Cards and Drivers for the Macintosh Family. If you are writing a driver for a device on a card, you should also read the chapters “The Device Manager” and “Writing Your Own Device Driver” in this book.
  1764. After the introduction to the NuBus and expansion card design, this chapter discusses how you can
  1765. n    determine the version of the Slot Manager that is available
  1766. n    find information in the firmware of an expansion card
  1767. n    enable and disable data structures in expansion card firmware
  1768. n    load drivers and execute code from expansion card firmware
  1769. n    check the status of expansion cards
  1770. n    read and change the slot parameter RAM
  1771. Introduction to Slots and Cards
  1772. The Macintosh family of computers supports a processor-direct slot (PDS) expansion interface and a NuBus expansion interface. 
  1773. The processor-direct slot, or PDS, is connected to the processor bus, which gives it direct access to the microprocessor and therefore a speed advantage over the NuBus. However, since the PDS expansion interface is an extension of the microprocessor, the configuration of the slot connector depends on which processor is used by the computer. For information specific to PDS expansion cards, see Designing Cards and Drivers for the Macintosh Family.
  1774. The Macintosh II-family computers include the NuBus expansion interface with configurations ranging from one to six identical slot connectors. The Macintosh system uses a slot ID in the range $09 to $0E to identify NuBus slots.
  1775. For convenience, this section refers to a NuBus configuration with six slots represented by slot IDs $09 through $0E. Keep in mind that some Macintosh family computers use only some of these slot IDs. For example, the Macintosh IIcx uses only slot IDs $09 through $0B. See Guide to the Macintosh Family Hardware for more information. <36pt\>\x12 <8bat\>u
  1776. In the Macintosh II-family of computers, the processor bus (which connects the CPU to RAM, ROM, the FPU) and the NuBus (which connects the NuBus expansion slots) are connected by a processor-bus to NuBus interface, or bus interface, as shown in Figure 3-1.
  1777. Simplified processor-bus and NuBus architecture
  1778. Both the processor bus and the NuBus are 4 bytes wide. The bus interface transfers bytes between the buses in byte lanes. Because the processor bus and the NuBus interpret the significance of bytes within words differently, the bus interface must perform byte lane swapping between the two buses. 
  1779. The bus interface also performs some address translation between the two buses. It maps certain address ranges on each bus are to different address ranges on the other bus.
  1780. Designing Cards and Drivers for the Macintosh Family discusses byte lanes and address translation in more detail.
  1781. The next section, “Address allocations,” discusses the address ranges assigned by the Macintosh architecture to each NuBus slot. 
  1782. The section “Firmware,” on page 3-7 introduces the data structures card’s use to organize information in their firmware.
  1783. Address allocations
  1784. The Macintosh architecture assigns certain address ranges to each NuBus slot. The processor communicates with an expansion card by reading and writing to memory in the address range of the card. The expansion cards can also communicate with each other in this manner. 
  1785. The NuBus architecture allows full 32-bit addresses, providing four gigabytes of address space. Suitably equipped Macintosh computers with system software version 7.0 also support full 32-bit addressing, while earlier versions of the system software use 24-bit addressing. This section describes address space allocation in both the 24-bit and 32-bit modes.
  1786. In 32-bit mode, the Macintosh architecture assigns two address ranges to each NuBus slot: a 256-megabyte super slot space and a 16-megabyte standard slot space.
  1787. The four gigabytes of the 32-bit address space contain 16 regions of 256 megabytes apiece, each of which constitutes the super slot space for one possible slot ID. Each super slot space spans an address range $s000 0000 through $sFFF FFFF, where s is a hexadecimal digit $0 through $F. 
  1788. For example, the address ranges $9000 0000 – $9FFF FFFF constitute the super slot space for slot ID $09. Since the Macintosh II family uses only slot IDs $09 through $0E, only six super slot spaces, $9xxx xxxx through $Exxx xxxx, are actually used.
  1789. The standard slot spaces are 16 megabytes apiece and have addresses of the form $Fsxx xxxx (that is, $Fs00 0000 – $FsFF FFFF) where s is the slot ID. As with super slot spaces, the Macintosh uses only standard slot spaces corresponding to slot IDs $9 through $E (that is $F9xx xxxx through $FExx xxxx).
  1790. Figure 3-2 shows the super slot and standard slot subdivisions of the 32-bit addressing region.
  1791. NuBus address space
  1792. In Figure 3-2, the super slot space and the standard slot space for slot ID $09 are shaded.
  1793. In 24-bit mode, the Macintosh system can only address a fraction of each card’s allocated address range. In this mode, the system assigns each slot a one megabyte minor slot space. The bus interface translates 24-bit address on the processor bus with the form $sx xxxx (where s is a slot ID) into 32-bit NuBus addresses of the form $Fs0x xxxx, which is the first megabyte of the slot’s standard slot space.
  1794. For example, 24-bit addresses in the range $90 0000 through $9F FFFF constitute the minor slot space corresponding to slot ID $09. The hardware translates these addresses into the NuBus address range $F900 0000 through $F90F FFFF.
  1795. Table 3-1 shows the address allocations for each slot ID.
  1796. Slot allocations by slot ID
  1797.     Slot    24-bit minor     32-bit minor    Standard    Super
  1798.     ID    slot space    slot space    slot space    slot space
  1799.     $9    $9x xxxx    $F90x xxxx    $F9xx xxxx    $9xxx xxxx
  1800.     $A    $Ax xxxx    $FA0x xxxx    $FAxx xxxx    $Axxx xxxx
  1801.     $B    $Bx xxxx    $FB0x xxxx    $FBxx xxxx    $Bxxx xxxx
  1802.     $C    $Cx xxxx    $FC0x xxxx    $FCxx xxxx    $Cxxx xxxx
  1803.     $D    $Dx xxxx    $FD0x xxxx    $FDxx xxxx    $Dxxx xxxx
  1804.     $E    $Ex xxxx    $FE0x xxxx    $FExx xxxx    $Exxx xxxx
  1805. Firmware
  1806. The firmware of a NuBus expansion card contains information that identifies the card and its functions, and allows the card to communicate with the Slot Manager. It may also include other information, such as initialization code or code for drivers that communicate with devices on the card. The sole purpose of many Slot Manager routines is to provide access to this firmware information. 
  1807. This section discusses the structure of the information in firmware. You’ll need to understand the structure of this information in order to use the Slot Manager routines. If you plan to design firmware, you will want to supplement the information in this section with the information in Designing Cards and Drivers for the Macintosh Family.
  1808. The physical location of an expansion card’s firmware is called its declaration ROM. The firmware in a card’s declaration ROM includes these elements:
  1809. n    The format block. The format block allows the Slot Manager to find the declaration ROM and to validate it. It contains some identification information and an offset to the sResource directory.
  1810. n    The sResource directory. The sResource directory is a list that contains offsets to all of the sResource data structures in the card’s firmware.
  1811. n    The sResource data structures. A typical sResource data structure contains information about a single function or capability of the expansion card, although some sResource data structures may contain other data—for example, device drivers, icons, fonts, code, or vendor-specific information. 
  1812. Every card must have a single Board sResource data structure, which contains information about the card as a whole. An sResource data structure relating to a specific function is called a functional sResource, and a card may have as many of them as necessary. 
  1813. The next few sections discusses these data structures in more detail.
  1814. The format block
  1815. The format block always resides at the highest address in the standard slot space of a declaration ROM. It contains information about the declaration ROM and an offset to the sResource directory. The Slot Manager uses the format block to validate the declaration ROM and locate the sResource data structures.
  1816. The format block also contains a value that specifies which of the four byte lanes the declaration ROM uses, called the valid byte lanes. Some declaration ROMs do not use all four byte lanes and therefore the system cannot address every memory location in their address space.
  1817. Designing Cards and Drivers for the Macintosh Family defines the structure of the format block and gives examples of how the valid byte lanes affect communication with a declaration ROM.
  1818. The sResource directory
  1819. The sResource directory lists all the sResource data structures in the card firmware and provides an offset to each one.
  1820. Figure 3-3 shows the format of the sResource directory.
  1821. The sResource directory structure
  1822. Each element of the sResource directory contains an 8-bit sResource ID followed by a 24-bit offset. The sResource ID identifies the sResource data structure. Each sResource data structure in the card firmware has a unique ID. Apple reserves ID numbers in the range $00 – $EF for sResource data structures defined for all declaration ROMs; at present there is only one of these: sResource ID $01, which indicates a Board sResource. The sResource ID numbers appear in the sResource directory in ascending order.
  1823. The sResource ID $FF indicates an end-of-list marker. 
  1824. The offset field of each entry contains an offset (counting only bytes accessible by valid byte lanes) to the sResource data structure. The final offset field must have a value of 0.
  1825. sResource Data Structures
  1826. Every sResource data structure contains of an sResource list. Each entry of an sResource list contains information about the sResource or contains a signed offset to another data structure, which might contain icons, code, device drivers, or other information relating to the sResource. 
  1827. The sResource data structure is made up of its sResource list and all the information pointed to by the sResource list entries.
  1828. An sResource data structure is sometimes referred to as a slot resource. Note, however, that a slot resource is a data structure in the firmware of a NuBus card and not a type of Macintosh resource. <36pt\>\x12 <8bat\>u
  1829. The sResource list structure is similar to the sResource directory structure. Each sResource list entry has an 8-bit ID field, which identifies the type of the entry, and a 24-bit offset field, which can contain a byte of data, a word of data, or an offset to a larger block of data. The final entry in an sResource must contain the value $FF in the type field and the value 0 in the data field.
  1830. Figure 3-3 shows the format of an sResource list.
  1831. sResource list structure
  1832. The ID field of each entry indicates the type of information in the offset field of the entry. Apple reserves the range $00 – $7E for common sResource entry types. Designing Cards and Drivers for the Macintosh Family gives a complete list of the Apple-defined sResource list IDs and their meanings.
  1833. The offset field of each entry in an sResource list can contain data or it can contain an offset to a block of data. This field takes one of three possible forms:
  1834. n    It may contain two $00 bytes followed by an 8-bit byte of data.
  1835. n    It may contain a $00 byte followed by a 16-bit word of data.
  1836. n    It may contain a 24-bit offset to larger data structures 
  1837. Table 3-2 lists the larger data structures commonly used in sResource data structures.
  1838. Larger Data Types
  1839.     Data Type    Description
  1840.     Long    32 bits, signed or unsigned.
  1841.     Pointer    32 bits, signed or unsigned.
  1842.     cString    One-dimensional array of bytes, ending with $00.
  1843.     sBlock    A sized block of data. See Figure 3-5.
  1844.     SExecBlock    A sized block of code. See Figure 3-5.
  1845. The sBlock and SExecBlock data structures begin with a size field, which contains the physical size of the block (including the size field). The sBlock structure follows the size field with its actual data. The SExecBlock field follows the size field with some additional fields and code. 
  1846. Format of the sBlock and SExecBlock data structures
  1847. sResource Types and sResource Names
  1848. The Slot Manager requires that each sResource list contain an sRsrcType entry, which identifies the sResource type, and an sRsrcName entry, which provides the sResource name.
  1849. The sRsrcType entry contains an offset to an sRsrcType record—a record containing 2 long words that identifies the sResource type.
  1850. Figure 3-6 shows the format of an sRrscType record.
  1851. The sRsrcType record format
  1852. Category    The most general classification of card functions. Some example categories are CatDisplay and CatNetwork.
  1853. cType    The subclass of the category. Within the CatDisplay category, for example, there is a TypVideo subcategory; within the CatNetwork category, there is a TypAppleTalk subcategory.
  1854. DrSW    The driver software interface of the subcategory. For example, under the category Display and the subcategory Video, there is a DrSWApple software interface, which indicates the Apple-defined interface to work with QuickDraw using Macintosh Operating System frame buffers.
  1855. DrHW    The identification of the specific hardware device associated with the driver software interface. 
  1856. The value of each sRsrcType entry is unique and assigned by Apple Developer Technical support. 
  1857. The sRsrcName entry contains an offset to a cString data structure containing the sResource name. By convention, the sRsrcName field is derived by stripping the prefixes from the sRsrcType values and separating the fields by underscores. For example, the sRsrcName for an sResource whose sRsrcType values are CatDisplay, TypVideo, DrSWApple, and DrHWTFB becomes 'Display_Video_Apple_TFB'.
  1858. Designing Cards and Drivers for the Macintosh Family provides information about these and other entry types.
  1859. The Board sResource
  1860. The Board sResource is a special sResource data structure that must be present in the firmware of every card that communicates with the Slot Manager. By convention, it has sResource ID $01 and it appears first in the sResource directory.
  1861. The entries in the Board sResource list provide the Slot Manager with a card’s identification number, vendor information, board flags, and initialization code. Like all sResource data structures, the Board sResource list must include an sRsrcType entry and an sRsrcName entry. The Board sRsrcType entry must contain the constants CatBoard ($0001), TypBoard ($0000), DrSWBoard ($0000), and DrHWBoard ($0000). The Board sResource name does not follow the same convention as other sResource names—the Board sResource name is the name of the entire card, for example 'Mac II Monochrome Video Card'.
  1862. The Board sResource list must also contain a BoardId entry, a word that contains the card design identification number assigned by Apple Macintosh Developer Technical Support. Other Apple-defined entries specifically for Board sResource data structures are discussed in Designing Cards and Drivers for the Macintosh Family.
  1863. Figure 3-7 shows a sample Board sResource. It shows an sRsrcType and sRsrcName entry and also includes three entry types, BoardID, PRAMInitData, and PrimaryInit, that are discussed in Designing Cards and Drivers for the Macintosh Family.
  1864. Sample Board sResource
  1865. About the Slot Manager
  1866. The Slot Manager provides three basic services:
  1867. n    At system startup time, it examines each slot and initializes any expansion cards it finds.
  1868. n    It maintains data structures that contain information about each slot and every available sResource data structure.
  1869. n    It provides functions that allow you to get information about expansion cards and their sResource data structures.
  1870. There are two variations of the system software version 7.0 Slot Manager: version 1 and version 2. Version 1 of Slot Manager is supplied with the version 7.0 System file on disk for use with Macintosh II-family computers designed and built before the system software version 7.0 was available. Version 2 is included in the ROM of newer Macintosh II-family computers.
  1871. When the user starts up a Macintosh II-family computer, the version of the Slot Manager in ROM searches each slot for a declaration ROM and creates a slot information record for each slot. The section “Getting Information about Expansion Cards and Declaration ROMs” reference section, later in this chapter, shows the definition of the SInfoRecord data type.
  1872. The ROM of early Macintosh II-family computers may contain early versions of the Slot Manager that address NuBus cards in 24-bit mode and may not be able to identify some cards. After version 1 of the Slot Manager is loaded, it locates these cards. <36pt\>\x12 <8bat\>u
  1873. As the Slot Manager searches the slots, it identifies all of the sResource data structures in each declaration ROM and creates a table—the Slot Resource Table, or SRT—that lists all of the sResource data structures currently available to the system. 
  1874. The Slot Manager then initializes the six parameter RAM bytes reserved for each slot. If the slot has an expansion card with a PRAMInitData entry in its Board sResource, the Slot Manager uses the values in that entry to initialize the parameter RAM; otherwise, it clears the parameter RAM bytes to 0. 
  1875. After the parameter RAM initialization, the Slot Manager disables interrupts and executes the code in the PrimaryInit entry of each card’s Board sResource. 
  1876. If certain values (defined by the Start Manager) are set in a card’s parameter RAM, a card with an sRsrcBootRec entry may take over the system startup process. The system gives control to the code in this entry early in the startup sequence, before the system patches are loaded.
  1877. Designing Cards and Drivers for the Macintosh Family describes the PRAMInitData, PrimaryInit, and sRsrcBootRec entry types.
  1878. If no card takes over, the normal system startup continues. After version 1 of the Slot Manager is loaded, it conducts a second search for declaration ROMs, this time in 32-bit mode. If it finds any new NuBus cards, it adds their sResource data structures to the Slot Resource Table and executes the code in their PrimaryInit entries. (Version 2 of the Slot Manager, which resides in ROM, does not need to conduct a second search.)
  1879. After all system patches have been installed, version 1 or later of the Slot Manager executes the code in any SecondaryInit entries it finds in the declaration ROMs. It does not reexecute the code from PrimaryInit entries, reinitialize parameter RAM, or restore any sResource data structures deleted by the PrimaryInit code. 
  1880. Versions of the Slot Manager earlier than version 1 do not execute code from SecondaryInit entries. <36pt\>\x12 <8bat\>u
  1881. After the Slot Manager executes SecondaryInit code, it searches for sResource data structures that have an sRsrcFlags entry with the fOpenAtStart flag set. When the Slot Manager finds an sResource data structure with this flag set, it loads the device driver from the sRsrcDrvrDir entry of the sResource, or calls the code in sResource’s sRsrcLoadRec entry, which loads the sResource’s device driver.
  1882. Finally, the system executes initialization ('INIT') resources.
  1883. See Designing Cards and Drivers for the Macintosh Family for details about the sRsrcFlags, sRsrcDrvrDir, and sRsrcLoadRec entry types.
  1884. Using the Slot Manager
  1885. The majority of Slot Manager routines search for sResource data structures in the Slot Resource Table or provide information from these structures. 
  1886. The Slot Manager provides a variety of methods to find an sResource data structure. These methods include searching for an sResource data structure with a particular sResource ID, searching for an sResource data structure with a particular sResource type, searching through all sResource data structures, searching through only the enabled sResource data structures, and so on.
  1887. The Slot Manager also provides a number of routines that return information from sResource list entries. Some of these routines, like the SReadByte and SGetCString functions, return one particular type of data structure. Some others, like the SFindStruct function, can return information about any data structure. Still other functions, the SGetDriver and SExec functions, not only return information from an sResource data structure but also preform functions like loading the sResource data structure’s driver or executing the code of an SExecBlock data structure.
  1888. In addition to searching for sResource data structures and getting information out of them, the Slot Manager allows you to enable and disable NuBus cards, manipulate the Slot Resource Table, get information from slot information records, get status information, and read and change expansion cards’ parameter RAM.
  1889. Enabling and Disabling NuBus Cards
  1890. Version 1 and later of the Slot Manager allows you to temporarily disable your NuBus card. You might want to do this, for example, if you are designing a NuBus card that must be addressed in 32-bit mode or that requires RAM-based system software patches to be loaded into memory before the card is initialized. Your PrimaryInit code can disable the card temporarily and the SecondaryInit code can reenable it. 
  1891. To disable a NuBus card temporarily, the initialization routine in your PrimaryInit record should return in the seStatus field of the SEBlock data structure (described in “Loading Drivers and Executing Code from sResource Data Structures” on page 3-53) an error code with a value in the range svTempDisable ($8000) through svDisabled ($8080). The Slot Manager places this code in the siInitStatusV field of the slot information record that the Slot Manager maintains for the slot, and it places the fatal error smInitStatVErr (–355) in the initStatusA field of the sInfo record. The card and its sResource data structures are then unavailable for use by the Operating System.
  1892. After the Operating System loads RAM patches, the Slot Manager checks the value of the siInitStatusA field. If this value is greater than or equal to 0, indicating no error, the Slot Manager executes the SecondaryInit code. If the value in the siInitStatusA field is smInitStatErr, the Slot Manager checks the siInitStatusV field. If the value of the siInitStatusV field is in the range svTempDisable through svDisabled, the Slot Manager clears the siInitStatusA field and runs the SecondaryInit code.
  1893. For examples of PrimaryInit and SecondaryInit code, see Designing Cards and Drivers for the Macintosh Family.
  1894. Deleting and Restoring sResource Data Structures
  1895. Some NuBus cards have sResource data structures to support a variety of combinations of system configurations or modes. The Slot Manager loads all of the sResource data structures during system initialization, and then the card’s PrimaryInit code can delete from the Slot Resource Table any sResource data structures that are not appropriate for the system as configured. If the user changes the system configuration or selects a different mode of operation, you can reinstall a deleted sResource data structure. The SDeleteSRTRec function deletes sResource data structures; the InsertSRTRec function reinstalls them.
  1896. Because none of the Slot Manager functions can search for sResource data structures that have been deleted from the Slot Resource Table, you must keep a record of all sResource data structures that you have deleted so that you will have the appropriate parameter values when you want to reinstall one.
  1897. When you reinstall an sResource data structure, you can also update the dCtlDevBase field in the corresponding device driver’s device control entry. The dCtlDevBase field holds the address of the sResource data structure that is used by that device driver. For a video driver, for example, the dCtlDevBase field might contain the address of the frame buffer. Use the InsertSRTRec to update the dCtlDevBase field. See the Device Manager chapter of this volume for a definition of the device control entry.
  1898. Enabling and Disabling sResource Data Structures
  1899. Under certain circumstances, you might want to disable an sResource data structure while it remains listed in the Slot Resource Table. For example, a NuBus card might provide several modes of operation, only one of which can be active at a given time. Your application might want to disable the sResource data structures associated with all but the active mode, but still list all available modes in a menu. When the user selects a new mode, your application can then disable the currently active sResource data structure and enable the one the user selected.
  1900. You use the SetSRsrcState function to enable or disable an sResource data structure. Listing 3-1 disables the sResource data structure in slot $0A with an sResource ID of 128 and enables the sResource data structure in the same slot with an ID of 131.
  1901. Disabling and Enabling sResource data structures
  1902. VAR
  1903.                 mySpBlk: SpBlock;
  1904.                 myErr:            OSErr;
  1905.  
  1906. BEGIN
  1907.                 {Set required values in parameter block.}
  1908.                 WITH mySpBlk DO 
  1909.                 BEGIN
  1910.                     spParamData := 1;                            {disable}
  1911.                     spSlot := $0A;                            {slot number}
  1912.                     spID := 128;                            {sResource ID}
  1913.                     spExtDev := 0;                            {ID of external device}
  1914.                 END;
  1915.                 myErr := SetSRsrcState(@mySpBlk);
  1916.                 IF myErr <> noErr THEN DoError(myErr);
  1917.  
  1918.                 WITH mySpBlk DO 
  1919.                 BEGIN
  1920.                     spParamData := 0;                            {enable}
  1921.                     spSlot := $0A;                            {slot number}
  1922.                     spID := 131;                            {sResource ID}
  1923.                     spExtDev := 0;                            {ID of external device}
  1924.                 END;
  1925.                 myErr := SetSRsrcState(@mySpBlk);
  1926.                 IF myErr <> noErr THEN DoError(myErr);
  1927. END;
  1928. Searching for sResource Data Structures
  1929. The Slot Manager provides several routines that search for sResource data structures in the Slot Resource Table. These routines all allow you to specify for which sResource data structures to search, but they each provide slightly different options.
  1930. The SFindSRsrcPtr and SGetSRsrcPtr functions are the simplest. The SFindSRsrcPtr function requires you to specify a slot number and an sResource ID and returns a pointer to the sResource data structure with the specified ID in the specified slot. 
  1931. The SGetSRsrcPtr function allows you to specify that you want the function to return a pointer to the next sResource data structure—that is, the one with the next higher sResource ID. When searching for the next sResource data structure, the SGetSRsrcPtr function also allows you to search for both enabled and disabled sResource data structures, or enabled ones only.
  1932. The SNextSRsrc and SGetSRsrc functions are similar, although they return more information about the sResource data structure, such as the fields of its sRsrcType entry. 
  1933. The SNextTypeSRsrc and SGetTypeSRsrc functions allow even more control. With these functions, you can search for the next sResource data structure with a particular sResource type.
  1934. Table 1-1 summarizes the Slot Manager search routines and the options available for each.
  1935. Slot Manager search routines 
  1936.     State of         Which     Type of 
  1937.     sResources it     Slots it     sResource it     sResource it 
  1938. Function    searches for    searches    searches for    searches for
  1939. SFindSRsrcPtr    Enabled only    Specified slot     Specified     Any type
  1940.              sResource only 
  1941. SNextSRsrc    Enabled only    Specified slot and    Next sResource     Any type
  1942.         higher slots     only 
  1943. SGetSRsrcPtr*,    Your choice of    Your choice of one    Your choice of     Any type
  1944. SGetSRsrc*    enabled only or    slot only or    specified 
  1945.     both enabled and    specified slot and    sResource or 
  1946.     disabled    higher slots    next sResource
  1947. SNextTypeSRsrc    Enabled only    Specified slot and    Next sResource    Specified type 
  1948.         higher slots     only    only
  1949. SGetTypeSRsrc*    Your choice of    Your choice of    Next sResource    Specified type
  1950.     enabled only or    one slot only or    only    only
  1951.     both enabled and    specified slot and
  1952.     disabled    higher slots
  1953. * Available only with system software version 7.0 Slot Manager
  1954. Listing 3-2 shows how to search all slots for both enabled and disabled sResource data structures with an sResource type category of catDisplay and an sResource type subcategory of typVideo.
  1955. Searching for sResource data structures
  1956. VAR
  1957.         mySpBlk: SpBlock;
  1958.         myErr:            OSErr;
  1959.  
  1960. BEGIN
  1961.         {Set required values in parameter block.}
  1962.         WITH mySpBlk DO 
  1963.         BEGIN
  1964.             spParamData := 1;                                    {fAll flag 1: search all sResources}
  1965.                                                 {fOneSlot flag 0: search all slots}
  1966.             spCategory := $catDisplay;                                    {search for Category catDisplay}
  1967.             spCategory := $typeVideo;                                    {search for cType typeVideo}
  1968.             spDrvrSW := 0;                                    {this field not being matched}
  1969.             spDrvrHW := 0;                                    {this field not being matched}
  1970.             spTBMask := 0;                                    {match only Category and cType fields}
  1971.             spSlot := 0;                                    {start search from here}
  1972.             spID := 0;                                    {start search from here}
  1973.             spExtDev := 0;                                    {ID of the external device}
  1974.         END;
  1975.         myErr := 0;
  1976.  
  1977.         WHILE myErr = noErr DO                                        {loop to search sResources}
  1978.         BEGIN
  1979.             myErr := SGetTypeSRsrc(@mySpBlk);
  1980.             MySRsrcProcessor(mySpBlk);                                    {your routine to process results}
  1981.         END;
  1982.         IF myErr <> smNoMoresRsrcs THEN DoError(myErr);
  1983. END;
  1984. Getting Information from sResource Data Structures
  1985. If you are writing a driver for a card device, you will most likely want access to the information in an sResource data structure. 
  1986. The Slot Manager provides many functions that return information from the entries of an sResource data structure. The SOffsetData, SReadByte, and SReadWord functions return information from the offset field of an sResource list entry. The SReadLong, SGetCString, and SGetBlock functions return copies of the standard data structures pointed to by the offset field of an sResource list entry. The SFindStruct and SReadStruct functions allow access to other data structures pointed to by sResource list entries.
  1987. Listing 3-3 shows an example of reading information from an sResource. This example examines the name of the card in slot $0A.
  1988. Searching for sResource data structures
  1989. VAR
  1990.                 mySpBlk: SpBlock;
  1991.                 myErr:            OSErr;
  1992.  
  1993. BEGIN
  1994.                 {First get a pointer to the Board sResource for slot $0A.}
  1995.                 WITH mySpBlk DO 
  1996.                 BEGIN
  1997.                     spSlot := $0A;                                {search in this slot}
  1998.                     spID := 1;                                {assume Board sResource has ID 1}
  1999.                 END;
  2000.                 myErr := SFindSRsrcPtr(@mySpBlk);
  2001.                 IF myErr <> noErr THEN DoError(myErr);
  2002.  
  2003.                 {The spsPointer field of mySpBlock now contains a pointer }
  2004.                 { to the Board sResource list. The SGetCString function }
  2005.                 { uses this field as one of two input fields.}
  2006.                 mySpBlk.spID := 2;                                    {sRsrcName entry}
  2007.  
  2008.                 myErr := SGetCString(@mySpBlk);
  2009.                 IF myErr <> noErr THEN DoError(myErr);
  2010.  
  2011.                 {The spResult field now points to a copy of the cString}
  2012.                 MyProcessCardName(mySpBlk.spResult);
  2013. END;
  2014. Reference to the Slot Manager
  2015. This section describes the routines you use to get information about the Slot Manager, expansion cards, and sResource data structures. Most of the routines in this section find an sResource data structure given some information about it or read information from an entry in an sResource list. Some of the routines allow you to read and set information about expansion cards, such as their parameter RAM values, and others allow you to manipulate Slot Manager data structures, like the Slot Resource Table.
  2016. Data Structures
  2017. Every Slot Manager function requires a pointer to a parameter block as a parameter, and returns an OSErr result code. Each routine uses only a subset of the fields of the parameter block, which is defined in Listing 3-4. See the routine descriptions for a list of the fields used with each routine.
  2018. Slot Manager parameter block
  2019. TYPE SpBlockPtr = ^SpBlock;
  2020. SpBlock = PACKED RECORD
  2021.                 spResult:                    LongInt;                 {result}
  2022.                 spsPointer:                    Ptr;                 {structure pointer}
  2023.                 spSize:                    LongInt;                 {size of structure}
  2024.                 spOffsetData:                    LongInt;                 {offset or data}
  2025.                 spIOFileName:                    Ptr;                 {reserved for Slot Manager}
  2026.                 spsExecPBlk:                    LongInt;                 {pointer to SEBlock data structure}
  2027.                 spParamData:                    Ptr;                 {flags}
  2028.                 spMisc:                    LongInt;                 {reserved for Slot Manager}
  2029.                 spReserved:                    LongInt;                 {reserved for Slot Manager}
  2030.                 spIOReserved:                    INTEGER;                 {ioReserved field from SRT}
  2031.                 spRefNum:                    INTEGER;                 {driver reference number}
  2032.                 spCategory:                    INTEGER;                 {Category field of sResource type}
  2033.                 spCType:                    INTEGER;                 {cType field of sResource type}
  2034.                 spDrvrSW:                    INTEGER;                 {DrvrSW field of sResource type}
  2035.                 spDrvrHW:                    INTEGER;                 {DrvrHW field of sResource type}
  2036.                 spTBMask:                    SignedByte;                 {sResource type bit mask}
  2037.                 spSlot:                    SignedByte;                 {slot number}
  2038.                 spID:                    SignedByte;                 {sResource ID}
  2039.                 spExtDev:                    SignedByte;                 {external device ID}
  2040.                 spHwDev:                    SignedByte;                 {hardware device ID}
  2041.                 spByteLanes:                    SignedByte;                 {valid byte lanes}
  2042.                 spFlags:                    SignedByte;                 {flags used by Slot Manager}
  2043.                 spKey:                    SignedByte;                 {reserved for Slot Manager}
  2044. END;
  2045. spResult    A general-purpose field used to contain the results returned by several different routines.
  2046. spsPointer    A pointer to a data structure. The field can point to an sResource data structure, a data block, or a declaration ROM, depending on the routine being executed.
  2047. spSize    The size of the data block.
  2048. spOffsetData    The contents of the offset field of an sResource data structure entry. Some routines use this field for other offsets or data.
  2049. spIOFileName    Reserved for use by the Slot Manager.
  2050. spsExecPBlk    Pointer to an SEBlock data structure (an SExec parameter block).
  2051. spParamData    On input, this long word contains flags that determine what sResource data structures the Slot Manager searches. Bit 0 (the fAll flag) indicates when set that disabled sResource data structures should be included. When set, bit 1 (the fOneslot flag) restricts the search to sResource data structures on a single card. Bit 2 (the fNext flag) indicates when set that the routine find the next sResource data structure. The rest of the fields must be cleared to 0.
  2052.     On output, this field indicates whether the sResource data structure is enabled or disabled (if 0, the sResource data structure is enabled; if 1, it is disabled).
  2053. spMisc    Reserved for use by the Slot Manager.
  2054. spReserved    Reserved for future use.
  2055. spIOReserved    The value of the ioReserved field from the sResource data structure’s entry in the Slot Resource Table.
  2056. spRefNum    The driver reference number of the driver associated with an sResource data structure, if there is one.
  2057. spCategory    The Category field of the sResource type.
  2058. spCType    The cType field of the sResource type.
  2059. spDrvrSW    The DrvrSW of the sResource type.
  2060. spDrvrHW    The DrvrHW of the sResource type.
  2061. spTBMask    A mask that determines which sRsrcType fields the Slot Manager examines when searching for sResource data structures.
  2062. spSlot    The number of the slot with the NuBus card containing the requested, or returned, sResource data structure.
  2063. spID    The sResource ID of the requested, or returned, sResource data structure.
  2064. spExtDev    The external device identifier. This field allows you to distinguish between devices on a card.
  2065. spHwDev    The hardware device identifier from the sRsrcHWDevID field of the sResource data structure.
  2066. spByteLanes    The byte lanes used by a declaration ROM.
  2067. spFlags    Flags typically used by the Slot Manager.
  2068. spKey    Reserved for use by the Slot Manager.
  2069. Since each routine uses a subset of the parameter block fields, each routine reference section includes a list of pertinent fields and how they are used.
  2070. <symbol\>\xae     fieldName    FieldType        Input field.
  2071. <symbol\>\xac     fieldName    FieldType    Output field.
  2072. <symbol\>\xab     fieldName    FieldType    Input/output field.
  2073.  
  2074. <zapf\>5    fieldName    FieldType    Affected field.
  2075. The arrows show whether you provide a value in the field, the routine returns a value in the field, or both. The <zapf\>5 symbol designates fields that may be affected by the execution of the routine. Any value you store in one of these fields may be lost. Also, the meaning of these fields upon completion of the routine is undefined; your application should not depend on these values.
  2076. Determining the Version of the Slot Manager
  2077. Unlike many of the system software managers, which provide you with version information through the Gestalt function, the Slot Manager provides its own function for determining version information.
  2078. 3SVersion
  2079. You can use the SVersion function to determine which version of the Slot Manager is in use by the Operating System.
  2080. FUNCTION SVersion    (spBlkPtr: SpBlockPtr) : OSErr;
  2081. spBlkPtr    Pointer to a Slot Manager parameter block.
  2082. <symbol\>\xac     spResult    LongInt    The Slot Manager version number.
  2083. <symbol\>\xac     spsPointer    Ptr    A pointer to additional information.
  2084. DESCRIPTION
  2085. The SVersion function returns the version number of the Slot Manager in the spResult field. Version number 1 corresponds to the RAM-based Slot Manager and version number 2 corresponds to the ROM-based Slot Manager. Versions of the Slot Manager before system software version 7.0 do not recognize the SVersion function and return a nonfatal error smSelOOBErr. The spsPointer field is reserved for future use as a pointer to additional information.
  2086. SPECIAL CONSIDERATIONS
  2087. The SVersion function does not move memory; your application may call this function at interrupt time.
  2088. The SVersion function is available only with version 1 or later of the Slot Manager. You can use the error code smSelOOBErr to determine if an earlier version of the Slot Manager is in use by the Operating System.
  2089. ASSEMBLY-LANGUAGE INFORMATION
  2090. The trap macro for the SVersion function is _SlotManager ($A06E). The routine selector is $0008.
  2091. Trap macro        Selector
  2092. _SlotManager        $0008
  2093. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2094. Registers on entry
  2095. A0    address of the parameter block
  2096. D0    $0008
  2097. Registers on exit
  2098. D0    result code
  2099. RESULT CODES
  2100. noErr    0    No Error
  2101. smSelOOBErr    –338    Selector out of bounds; function not
  2102.         implemented
  2103. SEE ALSO
  2104. For more discussion on the different versions of the Slot Manager, see “About the Slot Manager” on page 3-12.
  2105. Finding sResource Data Structures
  2106. The routines in this section locate sResource data structures in the Slot Resource Table and return pointers to them and additional information about them. You can use some of the routines to step through the sResource data structures, and some of the routines allow you to find disabled as well as enabled sResource data structures.
  2107. 3SFindSRsrcPtr
  2108. You can use the SFindSRsrcPtr function to find an sResource data structure given its slot number and sResource ID. This function ignores disabled sResource data structures.
  2109. FUNCTION SFindSRsrcPtr    (spBlkPtr: SpBlockPtr) : OSErr;
  2110. spBlkPtr    Pointer to a Slot Manager parameter block.
  2111. <symbol\>\xac     spsPointer    Ptr    A pointer to the sResource data structure.
  2112. <symbol\>\xae     spSlot    SignedByte        The slot number of the requested sResource.
  2113. <symbol\>\xae     spId    SignedByte    The     sResource ID of the requested sResource.
  2114. <zapf\>5    spResult    LongInt
  2115. SPECIAL CONSIDERATIONS
  2116. The SFindSRsrcPtr function does not move memory; your application may call this function at interrupt time.
  2117. ASSEMBLY-LANGUAGE INFORMATION
  2118. The trap macro for the SFindSRsrcPtr function is _SlotManager ($A06E). The routine selector is $0030.
  2119. Trap macro        Selector
  2120. _SlotManager        $0030
  2121. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2122. Registers on entry
  2123. A0    address of the parameter block
  2124. D0    $0030
  2125. Registers on exit
  2126. D0    result code
  2127. RESULT CODES
  2128. noErr    0    No Error
  2129. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2130. SEE ALSO
  2131. For information about the sResource data structure, see the section “Firmware” on page 3-7.
  2132. 3SGetSRsrcPtr
  2133. You can use the SGetSRsrcPtr function to find an sResource data structure given its slot number and sResource ID. This function allows you to search disabled sResource data structures and allows you to step through sResource data structures.
  2134. FUNCTION SGetSRsrcPtr    (spBlkPtr: SpBlockPtr) : OSErr;
  2135. spBlkPtr    Pointer to a Slot Manager parameter block.
  2136. <symbol\>\xac     spsPointer    Ptr    A pointer to the sResource data structure.
  2137. <symbol\>\xae     spParamData    LongInt    The fAll, fOneslot, fNext flags.
  2138. <symbol\>\xae     spSlot    SignedByte            The slot number of the requested sResource.
  2139. <symbol\>\xae     spID    SignedByte    The     sResource ID of the requested sResource.
  2140. <symbol\>\xae     spExtDev    SignedByte    The     external device identifier.
  2141. DESCRIPTION
  2142. The SGetSRsrcPtr function allows you to find any sResource data structure from the Slot Resource Table, even disabled ones.
  2143. You specify an sResource data structure with the spSlot, spID, and spExtDev fields. You must also include flags in bits 0, 1, and 2 of the spParamData field as follows:
  2144. n    Set the fAll flag (bit 0) to search both enabled and disabled sResource data structures. Clear this flag to search only enabled sResource data structures.
  2145. n    Set the fOneslot flag (bit 1) to search only the specified slot. Clear this flag to search all slots.
  2146. n    Set the fNext flag (bit 2) to return information about the sResource data structure with the next higher sResource ID than the specified sResource data structure (or the first one on the next card if the fAll flag is set). Clear this flag to return data about the specified sResource data structure.
  2147. The SGetSRsrcPtr function returns a pointer to the specified sResource data structure, or the one following it if you set the fNext flag.
  2148. The SGetSRsrcPtr function updates the values in the spSlot, spID, and spExtDev fields to correspond to the sResource data structure that it found. If you cleared the fNext flag, these fields retain the values you specified when calling the function.
  2149. SPECIAL CONSIDERATIONS
  2150. The SGetSRsrcPtr function does not move memory; your application may call this function at interrupt time.
  2151. This function is available with version 1 or later of the Slot Manager.
  2152. ASSEMBLY-LANGUAGE INFORMATION
  2153. The trap macro for the SGetSRsrcPtr function is _SlotManager ($A06E). The routine selector is $001D.
  2154. Trap macro        Selector
  2155. _Slot Manager        $001D
  2156. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2157. Registers on entry
  2158. A0    address of the parameter block
  2159. D0    $001D
  2160. Registers on exit
  2161. D0    result code
  2162. RESULT CODES
  2163. noErr    0    No Error
  2164. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2165. SEE ALSO
  2166. For more information about the sResource data structure, see the section “Firmware” on page 3-7.
  2167. 3SRsrcInfo
  2168. You can use the SRsrcInfo function to find an sResource data structure given its slot number and sResource ID. This function also provides additional information about the sResource data structure.
  2169. FUNCTION SRsrcInfo    (spBlkPtr: SpBlockPtr) : OSErr;
  2170. spBlkPtr    Pointer to a Slot Manager parameter block.
  2171. <symbol\>\xac     spsPointer    Ptr    A pointer to the sResource data structure.
  2172. <symbol\>\xac     spIOReserved    Integer    Value of Slot Resource Table ioReserved field.
  2173. <symbol\>\xac     spRefNum    Integer    Device driver reference number.
  2174. <symbol\>\xac     spCategory    Integer    Category field of sResource type.
  2175. <symbol\>\xac     spCType    Integer    CType field of sResource type.
  2176. <symbol\>\xac     spDrvrSW    Integer    DrvrSW field of sResource type.
  2177. <symbol\>\xac     spDrvrHW    Integer    DrvrHW field of sResource type.
  2178. <symbol\>\xae     spSlot    SignedByte        The slot number of the requested sResource.
  2179. <symbol\>\xae     spId    SignedByte    The     sResource ID of the requested sResource.
  2180. <symbol\>\xae     spExtDev    SignedByte    External device identifier.
  2181. <symbol\>\xac     spHwDev    SignedByte    Hardware device identifier.
  2182. DESCRIPTION
  2183. The SRsrcInfo function allows you to find an sResource data structure from the Slot Resource Table, and provides additional information such as the type of the sResource data structure.
  2184. You specify an sResource data structure with the spSlot, spID, and spExtDev fields. 
  2185. The SRsrcInfo function returns a pointer to the sResource data structure in the spsPointer field and information about the sResource type in the spRefNum, spCType, spDrvrSW, spDrvrHW fields. The function returns other information about the sResource data structure in the spIOReserved, spRefNum, and spHwDev fields.
  2186. SPECIAL CONSIDERATIONS
  2187. The SRsrcInfo function does not move memory; your application may call this function at interrupt time.
  2188. ASSEMBLY-LANGUAGE INFORMATION
  2189. The trap macro for the SRsrcInfo function is _SlotManager ($A06E). The routine selector is $0016.
  2190. Trap macro        Selector
  2191. _SlotManager        $0016
  2192. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2193. Registers on entry
  2194. A0    address of the parameter block
  2195. D0    $0016
  2196. Registers on exit
  2197. D0    result code
  2198. RESULT CODES
  2199. noErr    0    No Error
  2200. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2201. SEE ALSO
  2202. For more information about the sResource data structure and fields of the sResource type, see “Firmware” on page 3-7.
  2203. For more control in finding sResource data structures, you can use the SGetSRsrc function, described on page 3-30, and the SGetTypeSRsrc function, described on page 3-33.
  2204. 3SNextSRsrc
  2205. You can use the SNextSRsrc function to step through the sResource data structures on a card or from one card to the next.
  2206. FUNCTION SNextSRsrc                                        (spBlkPtr: SpBlockPtr) : OSErr;
  2207. spBlkPtr    Pointer to a Slot Manager parameter block.
  2208. <symbol\>\xac     spsPointer    Ptr    A pointer to the sResource data structure.
  2209. <symbol\>\xac     spIOReserved    Integer    Value of Slot Resource Table ioReserved field.
  2210. <symbol\>\xac     spRefNum    Integer    The driver reference number.
  2211. <symbol\>\xac     spCategory    Integer    Category field of sRsrcType.
  2212. <symbol\>\xac     spCType    Integer    CType field of sRsrcType.
  2213. <symbol\>\xac     spDrvrSW    Integer    DrvrSW field of sRsrcType.
  2214. <symbol\>\xac     spDrvrHW    Integer    DrvrHW field of sRsrcType.
  2215. <symbol\>\xab     spSlot    SignedByte    The slot number.
  2216. <symbol\>\xab     spId    SignedByte    The     sResource ID.
  2217. <symbol\>\xab     spExtDev    SignedByte    External device identifier.
  2218. <symbol\>\xac     spHWDev    SignedByte    Hardware device identifier.
  2219. DESCRIPTION
  2220. The SNextSRsrc function is similar to the SRsrcInfo function, except the SNextSRsrc function returns information about the sResource data structure that follows the requested one—that is, the one with the next entry in the sResource directory or the first sResource on the next card. The SNextSRsrc function skips disable sResources.
  2221. You specify a particular sResource data structure with the spSlot, spID, and spExtDev fields. The SNextSRsrc function finds the next sResource data structure, returns a pointer to it in the spsPointer field, and updates the spSlot, spID, and spExtDev fields to correspond to the sResource data structure it found. If there are no more sResource data structures, the SNextSRsrc function returns with a nonfatal status error.
  2222. The SNextSRsrc function returns other information about the sResource data structure in the spIoReserved, spRefNum, spCategory, spCType, spDrvrSW, and spDrvrHW fields.
  2223. SPECIAL CONSIDERATIONS
  2224. The SNextSRsrc function does not move memory; your application may call this function at interrupt time.
  2225. ASSEMBLY-LANGUAGE INFORMATION
  2226. The trap macro for the SNextSRsrc function is _SlotManager ($A06E). The routine selector is $0014.
  2227. Trap macro        Selector
  2228. _SlotManager        $0014
  2229. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2230. Registers on entry
  2231. A0    address of the parameter block
  2232. D0    $0014
  2233. Registers on exit
  2234. D0    result code
  2235. RESULT CODES
  2236. noErr    0    No Error
  2237. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2238. SEE ALSO
  2239. For more information about the sResource directory and the sResource data structure, see “Firmware” on page 3-7.
  2240. For more control in finding sResource data structures, you can use the SGetSRsrc function, described on page 3-30, and the SGetTypeSRsrc function, described on page 3-33.
  2241. 3SGetSRsrc
  2242. You can use the SGetSRsrc function to find any sResource data structure, even one that has been disabled.
  2243. FUNCTION SGetSRsrc    (spBlkPtr: SpBlockPtr) : OSErr;
  2244. spBlkPtr    Pointer to a Slot Manager parameter block.
  2245. <symbol\>\xac     spsPointer    Ptr    A pointer to the sResource data structure.
  2246. <symbol\>\xab     spParamData    LongInt    On input: fAll, fOneslot, fNext flags.
  2247. On output: sResource enable or disabled.
  2248. <symbol\>\xac     spRefNum    Integer    Slot Resource Table reference number.
  2249. <symbol\>\xac     spCategory    Integer    Category field of sRsrcType.
  2250. <symbol\>\xac     spCType    Integer    CType field of sRsrcType.
  2251. <symbol\>\xac     spDrvrSW    Integer    DrvrSW field of sRsrcType.
  2252. <symbol\>\xac     spDrvrHW    Integer    DrvrHW field of sRsrcType.
  2253. <symbol\>\xab     spSlot    SignedByte    The slot number.
  2254. <symbol\>\xab     spId    SignedByte    The     sResource ID.
  2255. <symbol\>\xab     spExtDev    SignedByte    External device identifier.
  2256. <symbol\>\xac     spHWDev    SignedByte    Hardware device identifier.
  2257. DESCRIPTION
  2258. The SGetSRsrc function allows you to specify whether the function should include disabled sResources, whether it should continue looking for sResources in higher-numbered slots, and whether it should return information about the specified sResource data structure or the one that follows it.
  2259. You specify an sResource data structure with the spSlot, spID, and spExtDev fields. You must also include flags in bits 0, 1, and 2 of the spParamData field as follows:
  2260. n    Set the fAll flag (bit 0) to search both enabled and disabled sResource data structures. Clear this flag to search only enabled sResource data structures.
  2261. n    Set the fOneslot flag (bit 1) to search only the specified slot. Clear this flag to search all slots.
  2262. n    Set the fNext flag (bit 2) to return information about the sResource data structure with the next higher sResource ID than the specified sResource data structure (or the first one on the next card if the fAll flag is set). Clear this flag to return data about the specified sResource data structure.
  2263. The SGetSRsrc function returns values in the spSlot, spID, and spExtDev fields corresponding to the sResource data structure that it found. If you cleared the fNext flag, these fields retain the values you specified when calling the function. In addition, the function returns 0 in the spParamData field if the sResource data structure is enabled or 1 if it is disabled. If you cleared the fAll bit, the spParamData field always returns the value 0.
  2264. The SGetSRsrc function also returns a pointer to the sResource data structure in the spsPointer field and other information about the sResource data structure in the spRefNum, spCategory, spCType, spDrvrSW, spDrvrHW, and spHwDev fields. 
  2265. SPECIAL CONSIDERATIONS
  2266. The SGetSRsrc function does not move memory; your application may call this function at interrupt time.
  2267. The SGetSRsrc function is available only with version 1 or later of the Slot Manager.
  2268. ASSEMBLY-LANGUAGE INFORMATION
  2269. The trap macro for the SGetSRsrc function is _SlotManager ($A06E). The routine selector is $000B.
  2270. Trap macro        Selector
  2271. _SlotManager        $000B
  2272. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2273. Registers on entry
  2274. A0    address of the parameter block
  2275. D0    $000B
  2276. Registers on exit
  2277. D0    result code
  2278. RESULT CODES
  2279. noErr    0    No Error
  2280. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2281. SEE ALSO
  2282. For more information about the sResource data structure, see the section “Firmware” on page 3-7.
  2283. For more control in finding sResource data structures, you can use the SGetSRsrc function, described on page 3-30, and the SGetTypeSRsrc function, described on page 3-33.
  2284. 3SNextTypeSRsrc
  2285. You can use the SNextTypeSRsrc function to step through sResource data structures of one type.
  2286. FUNCTION SNextTypeSRsrc    (spBlkPtr: SpBlockPtr) : OSErr;
  2287. spBlkPtr    Pointer to a Slot Manager parameter block.
  2288. <symbol\>\xac     spsPointer    Ptr    A pointer to the sResource data structure.
  2289. <symbol\>\xac     spIOReserved    Integer    Value of Slot Resource Table ioReserved field.
  2290. <symbol\>\xac     spRefNum    Integer    Slot Resource Table reference number.
  2291. <symbol\>\xab     spCategory    Integer    Category field of sRsrcType.
  2292. <symbol\>\xab     spCType    Integer    CType field of sRsrcType.
  2293. <symbol\>\xab     spDrvrSW    Integer    DrvrSW field of sRsrcType.
  2294. <symbol\>\xab     spDrvrHW    Integer    DrvrHW field of sRsrcType.
  2295. <symbol\>\xae     spTBMask    SignedByte        DrvrHW field of sRsrcType.
  2296. <symbol\>\xab     spSlot    SignedByte        The slot number.
  2297. <symbol\>\xab     spId    SignedByte    The     sResource ID.
  2298. <symbol\>\xab     spExtDev    SignedByte    External device identifier.
  2299. <symbol\>\xac     spHWDev    SignedByte    Hardware device identifier.
  2300. DESCRIPTION
  2301. The SNextTypeSRsrc function allows you to find the next sResource data structure, as does the SNextSRsrc function, but the SNextTypeSRsrc function also allows you to specify the type of sResource data structures to find. The SNextTypeSRsrc function skips disable sResources.
  2302. You specify an sResource data structure with the spSlot, spID, and spExtDev fields, and you specify the type of the sResource with the spCategory, spCType, spDrvrSW, and spDrvrHW fields. You must also use the spTBMask to specify which of these D fields should not be included in the search:
  2303. n    Set bit 0 to ignore the DrvrHW field.
  2304. n    Set bit 1 to ignore the DrvrSW field.
  2305. n    Set bit 2 to ignore the cType field.
  2306. n    Set bit 3 to ignore the Category field.
  2307. The SNextTypeSRsrc function returns values in the spSlot, spID, and spExtDev fields corresponding to the sResource data structure that it found, and it returns 0 in the spParamData field in that sResource is enabled or 1 if it is disabled.
  2308. The SNextTypeSRsrc function also returns a pointer to the sResource data structure in the spsPointer field and other information about the sResource data structure in the spIOReserved, spRefNum, spCategory, spCType, spDrvrSW, and spDrvrHW fields. 
  2309. SPECIAL CONSIDERATIONS
  2310. The SNextTypeSRsrc function does not move memory; your application may call this function at interrupt time.
  2311. ASSEMBLY-LANGUAGE INFORMATION
  2312. The trap macro for the SNextTypeSRsrc function is _SlotManager ($A06E). The routine selector is $0015.
  2313. Trap macro        Selector
  2314. _SlotManager        $0015
  2315. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2316. Registers on entry
  2317. A0    address of the parameter block
  2318. D0    $0015
  2319. Registers on exit
  2320. D0    result code
  2321. RESULT CODES
  2322. noErr    0    No Error
  2323. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2324. SEE ALSO
  2325. For more information about the sResource data structure, see the section “Firmware” on page 3-7.
  2326. For information on enabling and disabling sResource data structures, see the “Enabling and Disabling sResource Data Structures” on page 3-15 and the description of the SetSRsrcState function on page 3-35.
  2327. 3SGetTypeSRsrc
  2328. You can use the SGetTypeSRsrc function to step through sResource data structures of one type, including disabled ones.
  2329. FUNCTION SGetTypeSRsrc    (spBlkPtr: SpBlockPtr) : OSErr;
  2330. spBlkPtr    Pointer to a Slot Manager parameter block.
  2331. You specify values and receive return values in the Slot Manager parameter block.
  2332. <symbol\>\xac     spsPointer    Ptr    A pointer to the sResource data structure.
  2333. <symbol\>\xab     spParamData    LongInt    On input: fAll, fOneslot flags.
  2334. On output: sResource enable or disabled.
  2335. <symbol\>\xac     spRefNum    Integer    Slot Resource Table reference number.
  2336. <symbol\>\xab     spCategory    Integer    The Category field of the sResource type.
  2337. <symbol\>\xab     spCType    Integer    The cType field of the sResource type.
  2338. <symbol\>\xab     spDrvrSW    Integer    The DrvrSW field of the sResource type.
  2339. <symbol\>\xab     spDrvrHW    Integer    The DrvrHW field of the sResource type.
  2340. <symbol\>\xae     spTBMask    SignedByte        Type bit mask for sRsrcType fields.
  2341. <symbol\>\xab     spSlot    SignedByte        The slot number.
  2342. <symbol\>\xab     spId    SignedByte    The     sResource ID.
  2343. <symbol\>\xab     spExtDev    SignedByte    External device identifier.
  2344. <symbol\>\xac     spHWDev    SignedByte    Hardware device identifier.
  2345. DESCRIPTION
  2346. The SGetTypeSRsrc function allows you to find the next sResource data structure of a certain type, as does the SNextTypeSRsrc function, but the SGetTypeSRsrc function also allows you to find disabled sResource data structures and to limit searching to a single slot.
  2347. You specify an sResource data structure with the spSlot, spID, and spExtDev fields, and you specify the type of the sResource with the spCategory, spCType, spDrvrSW, and spDrvrHW fields. You must also use the spTBMask to specify which of these sRsrcType fields should not be included in the search:
  2348. n    Set bit 0 to ignore the DrvrHW field.
  2349. n    Set bit 1 to ignore the DrvrSW field.
  2350. n    Set bit 2 to ignore the cType field.
  2351. n    Set bit 3 to ignore the Category field.
  2352. You must also set the fAll flag of the spParamData field (bit 0) to search both enabled and disabled sResource data structures or clear this flag to search only enabled ones. Set the fOneslot flag (bit 1) to search only the specified slot or clear this flag to search all slots. This function does not use the fNext flag (bit 2) because it always searches for the next sResource data structure of the given type.
  2353. The SGetTypeSRsrc function returns values in the spSlot, spID, and spExtDev fields corresponding to the sResource data structure that it found, and it returns 0 in the spParamData field in that sResource is enabled or 1 if it is disabled.
  2354. The SGetTypeSRsrc function also returns a pointer to the sResource data structure in the spsPointer field and other information about the sResource data structure in the spRefNum, spCategory, spCType, spDrvrSW, spDrvrHW, and spHwDev fields. 
  2355. SPECIAL CONSIDERATIONS
  2356. The SGetTypeSRsrc function does not move memory; your application may call this function at interrupt time.
  2357. The SGetTypeSRsrc function is available only with version 1 or later of the Slot Manager.
  2358. ASSEMBLY-LANGUAGE INFORMATION
  2359. The trap macro for the SGetTypeSRsrc function is _SlotManager ($A06E). The routine selector is $000C.
  2360. Trap macro        Selector
  2361. _SlotManager        $000C
  2362. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2363. Registers on entry
  2364. A0    address of the parameter block
  2365. D0    $000C
  2366. Registers on exit
  2367. D0    result code
  2368. RESULT CODES
  2369. noErr    0    No Error
  2370. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2371. SEE ALSO
  2372. For more information about the sResource data structure, see the section “Firmware” on page 3-7. 
  2373. For information on enabling and disabling sResource data structures, see the “Enabling and Disabling sResource Data Structures” on page 3-15 and the description of the SetSRsrcState function on page 3-35.
  2374. Enabling, Disabling, Deleting, and Restoring sResource
  2375. Data Structures
  2376. The routines in this section are primarily for use by device drivers. The first routine enables and disables sResource data structures. The next two routines delete sResource data structures from and restore them to the Slot Resource Table.
  2377. 3SetSRsrcState
  2378. You can use the SetSRsrcState function to select which sResource data structures are enabled.
  2379. FUNCTION SetSRsrcState    (spBlkPtr: SpBlockPtr) : OSErr;
  2380. spBlkPtr    Pointer to a Slot Manager parameter block.
  2381. <symbol\>\xae     spParamData    LongInt    Enable or disable the resource.
  2382. <symbol\>\xae     spSlot    SignedByte        The slot number.
  2383. <symbol\>\xae     spId    SignedByte    The     sResource ID.
  2384. <symbol\>\xae     spExtDev    SignedByte    The external device identifier.
  2385. DESCRIPTION
  2386. The SetSRsrcState function enables or disables an sResource data structure. All of the Slot Manager routines recognize enabled sResource data structures, while only the SGetSRsrc and SGetTypeSRsrc functions can recognize disabled ones.
  2387. You specify the sResource data structure to enable or disable with the spSlot, spID, and spExtDev fields, and in the spParamData field you specify whether to enable or disable it. The Slot Manager enables the sResource data structure when this field has a value of 0 and disables it when the field has a value of 1.
  2388. SPECIAL CONSIDERATIONS
  2389. The SetSRsrcState function does not move memory; your application may call this function at interrupt time.
  2390. The SetSRsrcState function is available only with version 1 or later of the Slot Manager.
  2391. ASSEMBLY-LANGUAGE INFORMATION
  2392. The trap macro for the SetSRsrcState function is _SlotManager ($A06E). The routine selector is $0009.
  2393. Trap macro        Selector
  2394. _SlotManager        $0009
  2395. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2396. Registers on entry
  2397. A0    address of the parameter block
  2398. D0    $0009
  2399. Registers on exit
  2400. D0    result code
  2401. RESULT CODES
  2402. noErr    0    No Error
  2403. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2404. SEE ALSO
  2405. For more information about the sResource data structure, see the section “Firmware” on page 3-7. 
  2406. For information on enabling and disabling sResource data structures, see the “Enabling and Disabling sResource Data Structures” on page 3-15 and the description of the SetSRsrcState function on page 3-35.
  2407. For information on finding disabled sResource data structures see the description of the SGetSRsrc function on “SGetSRsrc” on page 3-30 and the description of the SGetTypeSRsrc function on “SGetTypeSRsrc” on page 3-33.
  2408. 3SDeleteSRTRec
  2409. You can use the SDeleteSRTRec function to remove an sResource data structure from the Slot Resource Table. 
  2410. FUNCTION SDeleteSRTRec    (spBlkPtr: SpBlockPtr) : OSErr;
  2411. spBlkPtr    Pointer to a Slot Manager parameter block.
  2412. <symbol\>\xae     spSlot    SignedByte        The slot number.
  2413. <symbol\>\xae     spId    SignedByte    The     sResource ID.
  2414. <symbol\>\xae     spExtDev    SignedByte    The external device identifier.
  2415. SPECIAL CONSIDERATIONS
  2416. The SDeleteSRTRec function may move memory; your application should not call this function at interrupt time.
  2417. The SDeleteSRTRec function is available only with version 1 or later of the Slot Manager.
  2418. ASSEMBLY-LANGUAGE INFORMATION
  2419. The trap macro for the SDeleteSRTRec function is _SlotManager ($A06E). The routine selector is $0031.
  2420. Trap macro        Selector
  2421. _SlotManager        $0031
  2422. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2423. Registers on entry
  2424. A0    address of the parameter block
  2425. D0    $0031
  2426. Registers on exit
  2427. D0    result code
  2428. SEE ALSO
  2429. For more information about the Slot Resource Table, see “About the Slot Manager” on page 3-12. 
  2430. For more information about restoring an sResource data structure to the Slot Resource Table, see the next section, which describes the InsertSRTRec function.
  2431. 3InsertSRTRec
  2432. You can use the InsertSRTRec function to add an sResource data structure to the Slot Resource Table. 
  2433. FUNCTION InsertSRTRec    (spBlkPtr: SpBlockPtr) : OSErr;
  2434. spBlkPtr    Pointer to a Slot Manager parameter block.
  2435. <symbol\>\xae     spsPointer    Ptr    NIL.
  2436. <symbol\>\xae     spParamData    LongInt    Enable or disable the sResource.
  2437. <symbol\>\xae     spRefNum    Integer    Device driver reference number.
  2438. <symbol\>\xae     spSlot    SignedByte        The slot number.
  2439. <symbol\>\xae     spId    SignedByte    The     sResource ID.
  2440. <symbol\>\xae     spExtDev    SignedByte    External device identifier.
  2441. DESCRIPTION
  2442. The InsertSRTRec function installs an sResource data structure from the firmware of a NuBus card into the Slot Resource Table. For example, if the user makes a selection in the Monitors control panel that requires your video card to switch to a new sResource data structure that was deleted by PrimaryInit code, you can use the InsertSRTRec function to restore that sResource data structure.
  2443. You specify an sResource data structure with the spSlot, spID, and spExtDev fields. You must set the spsPointer field to NIL. Set the spParamData field to 1 to disable the restored sResource data structure or to 0 to enable it.
  2444. If you place a valid device driver reference number in the spRefNum field, the Slot Manager updates the dCtlDevBase field in that device driver’s device control entry (that is, in the device control entry that has that driver reference number in the dCtlRefNum field). The dCtlDevBase field contains the base address of the memory buffer for data provided by the sResource data structure that is used by that device driver. 
  2445. The Slot Manager calculates this address by using bit 2 (the f32BitMode flag) of the sRsrcFlags field of the sResource data structure. As shown in Table 3-4, the Slot Manager first checks the value of bit 2 of the sRsrcFlags. Then, it checks for a MinorBaseOS entry. If it finds one, it uses this value to create a 32-bit value to store in the dCtlDevBase field. If it does not find one, it uses the value in the MajorBaseOS entry.
  2446. How the Slot Manager determines the base address used by an sResource
  2447.     sRsrcFlags    MinorBaseOS    MajorBaseOS    Address format
  2448.     Field missing    $x xxxx        Any or none    $Fs0x xxxx
  2449.     Field missing    None        $xx xxxx    $sxxx xxxx
  2450.     Bit 2 is 0    $x xxxx        Any or none    $Fs0x xxxx
  2451.     Bit 2 is 0    None        $xx xxxx    $sxxx xxxx
  2452.     Bit 2 is 1    $x xxxx        Any or none    $Fsxx xxxx
  2453.     Bit 2 is 1    None        $xx xxxx    $sxxx xxxx
  2454. In this table, x represents any hexadecimal digit and s represents a slot number. <36pt\>\x12 <8bat\>u
  2455. SPECIAL CONSIDERATIONS
  2456. The InsertSRTRec function may move memory; your application should not call this function at interrupt time.
  2457. The InsertSRTRec function is available only with version 1 or later of the Slot Manager.
  2458. ASSEMBLY-LANGUAGE INFORMATION
  2459. The trap macro for the InsertSRTRec function is _SlotManager ($A06E). The routine selector is $000A.
  2460. Trap macro        Selector
  2461. _SlotManager        $000A
  2462. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2463. Registers on entry
  2464. A0    address of the parameter block
  2465. D0    $000A
  2466. Registers on exit
  2467. D0    result code
  2468. RESULT CODES
  2469. noErr    0    No Error
  2470. memFullErr    –108    Not enough room in heap
  2471. smUnExBusErr    –308    Unexpected bus error
  2472. smBadRefId    –330    Reference ID not found in list
  2473. smBadsList    –331    Bad sResource structure: Id1 < Id2 < Id2 . . . 
  2474.         format is not followed
  2475. smReservedErr    –332    Reserved field not zero
  2476. smSlotOOBErr    –337    Slot number out of bounds
  2477. smNoMoresRsrcs    –344    Specified sResource data structure not found
  2478. smBadsPtrErr    –346    Bad pointer was passes to SCalcSPointer
  2479. smByteLanesErr    –347    ByteLanes field in card’s format block was
  2480.         determined to be zero
  2481. SEE ALSO
  2482. For more information about the sResource data structure, see the section “Firmware” on page 3-7. 
  2483. For more information about the device control entry and device driver reference numbers, see the chapter “The Device Manager” in this volume.
  2484. Getting Information from sResource Data Structures
  2485. The Slot Manager provides a number of routines that simplify access to the information in sResource data structures. Most of these routines simply return the value of an sResource list entry.
  2486. 3SReadDrvrName
  2487. You can use the SReadDrvrName function to read the name of an sResource data structure in a format you can use to open the driver with Device Manager routines.
  2488. FUNCTION SReadDrvrName    (spBlkPtr: SpBlockPtr) : OSErr;
  2489. spBlkPtr    Pointer to a Slot Manager parameter block.
  2490. <symbol\>\xae     spSlot    SignedByte        The slot number.
  2491. <symbol\>\xae     spID    SignedByte    The     sResource ID.
  2492. <symbol\>\xae     spResult    LongInt    Pointer to driver name.
  2493. 5    spSize    LongInt
  2494. 5    spsPointer    Ptr
  2495. DESCRIPTION
  2496. The SReadDrvrName function reads the name of an sResource data structure, prefixes a period to the value, and converts it to type Str255. The final driver name is compatible with the Device Manager’s OpenDriver function.
  2497. You specify the sResource data structure with the spSlot and spID fields. In your program, you should declare a Pascal string variable and pass a pointer to it in the spResult field. 
  2498. The SReadDrvrName function returns the driver name by copying it into the string pointed to by the spResult field.
  2499. This function may alter the values of the spSize and spsPointer fields of the parameter block. Your application should not depend on the values returned in these fields.
  2500. SPECIAL CONSIDERATIONS
  2501. The SReadDrvrName function does not move memory; your application may call this function at interrupt time.
  2502. ASSEMBLY-LANGUAGE INFORMATION
  2503. The trap macro for the SReadDrvrName function is _SlotManager ($A06E). The routine selector is $0019.
  2504. Trap macro        Selector
  2505. _SlotManager        $0019
  2506. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2507. Registers on entry
  2508. A0    address of the parameter block
  2509. D0    $0019
  2510. Registers on exit
  2511. D0    result code
  2512. RESULT CODES
  2513. noErr    0    No Error
  2514. smNoMoresRsrcs    –344    Requested sResource data structure not found
  2515. SEE ALSO
  2516. For more information about the sResource data structure, see the section “Firmware” on page 3-7. 
  2517. For more information about the device control entry and device driver reference numbers, see the chapter “The Device Manager” in this volume.
  2518. 3SOffsetData
  2519. You can use the SOffsetData function to determine the value of the offset field of an sResource list entry. 
  2520. FUNCTION SOffsetData    (spBlkPtr: SpBlockPtr) : OSErr;
  2521. spBlkPtr    Pointer to a Slot Manager parameter block.
  2522. <symbol\>\xab     spsPointer    Ptr    On input:     Pointer to the sResource list.
  2523. On output: Pointer to sResource list entry.
  2524. <symbol\>\xac     spOffsetData    LongInt    The contents of the offset field.
  2525. <symbol\>\xae     spID    SignedByte    The ID of the sResource list entry.
  2526. <symbol\>\xac     spByteLanes    SignedByte    Byte lanes from card format block.
  2527. 5    spResult    LongInt
  2528. 5    spFlags    SignedByte
  2529. DESCRIPTION
  2530. The SOffsetData function returns the contents of an offset field of an entry in an sResource list. This function provides low-level support for determining information in sResource list data structures. Many of the remaining routines in this section provide higher-level support.
  2531. You provide a pointer to the sResource list in the spsPointer field, and the ID of the entry in the spID field.
  2532. The SOffsetData function returns the value of the offset field, which can be a byte or a word of data or an offset to a larger block of data, in the spOffsetData field of the parameter block. The return value of the spsPointer field is a pointer to the specified entry in the sResource list—that is, an pointer to the entry’s ID field.
  2533. This function uses the spByteLanes field to return the value of the ByteLanes field from the format block of the card on which the sResource data structure resides. 
  2534. Your application should not depend on the values returned in the spResult and spFlags fields.
  2535. SPECIAL CONSIDERATIONS
  2536. The SOffsetData function does not move memory; your application may call this function at interrupt time.
  2537. ASSEMBLY-LANGUAGE INFORMATION
  2538. The trap macro for the SOffsetData function is _SlotManager ($A06E). The routine selector is $0024.
  2539. Trap macro        Selector
  2540. _SlotManager        $0024
  2541. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2542. Registers on entry
  2543. A0    address of the parameter block
  2544. D0    $0024
  2545. Registers on exit
  2546. D0    result code
  2547. SEE ALSO
  2548. For more information about the sResource list data structure, see the “Introduction to Cards and Slots” section at the beginning of this chapter. 
  2549. For information about routines that provide higher-level support for getting information from sResource lists, see the following reference sections which describe the SReadByte, SReadWord, SReadLong, SGetCString, SGetBlock, SReadStruct, and SFindStruct routines.
  2550. 3SReadByte
  2551. You can use the SReadByte function to determine the value of the low-order byte of an sResource list entry. 
  2552. FUNCTION SReadByte    (spBlkPtr: SpBlockPtr) : OSErr;
  2553. spBlkPtr    Pointer to a Slot Manager parameter block.
  2554. You specify values and receive return values in the Slot Manager parameter block.
  2555. <symbol\>\xac     spResult    LongInt    Contents of the entry byte.
  2556. <symbol\>\xae     spsPointer    Ptr    Pointer to the sResource list.
  2557. <symbol\>\xae     spID    SignedByte    The ID of the sResource list entry.
  2558. 5    spOffsetData    LongInt
  2559. 5    spByteLanes    SignedByte
  2560. DESCRIPTION
  2561. You provide a pointer to the sResource list in the spsPointer field, and the ID of the entry in the spID field. The SReadByte function returns the data byte in the spResult field.
  2562. This function may alter the values of the spOffsetData and spByteLanes fields of the parameter block. Your application should not depend on the values returned in these fields.
  2563. SPECIAL CONSIDERATIONS
  2564. The SReadByte function does not move memory; your application may call this function at interrupt time.
  2565. ASSEMBLY-LANGUAGE INFORMATION
  2566. The trap macro for the SReadByte function is _SlotManager ($A06E). The routine selector is $0000.
  2567. Trap macro        Selector
  2568. _SlotManager        $0000
  2569. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2570. Registers on entry
  2571. A0    address of the parameter block
  2572. D0    $0000
  2573. Registers on exit
  2574. D0    result code
  2575. SEE ALSO
  2576. For more information about the sResource list data structure, see the section “Firmware” on page 3-7. 
  2577. 3SReadWord
  2578. You can use the SReadWord function to determine the value of the low-order word of an sResource list entry. 
  2579. FUNCTION SReadWord    (spBlkPtr: SpBlockPtr) : OSErr;
  2580. spBlkPtr    Pointer to a Slot Manager parameter block.
  2581. <symbol\>\xac     spResult    LongInt    Contents of the entry word.
  2582. <symbol\>\xae     spsPointer    Ptr    Pointer to the sResource list.
  2583. <symbol\>\xae     spID    SignedByte    The ID of the sResource list entry.
  2584. 5    spOffsetData    LongInt
  2585. 5    spByteLanes    SignedByte
  2586. SPECIAL CONSIDERATIONS
  2587. The SReadWord function does not move memory; your application may call this function at interrupt time.
  2588. ASSEMBLY-LANGUAGE INFORMATION
  2589. The trap macro for the SReadWord function is _SlotManager ($A06E). The routine selector is $0001.
  2590. Trap macro        Selector
  2591. _SlotManager        $0001
  2592. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2593. Registers on entry
  2594. A0    address of the parameter block
  2595. D0    $0001
  2596. Registers on exit
  2597. D0    result code
  2598. SEE ALSO
  2599. For more information about the sResource list data structure, see the section “Firmware” on page 3-7. 
  2600. 3SReadLong
  2601. You can use the SReadLong function to determine the value of a longword pointed to by the offset field of an sResource list entry. 
  2602. FUNCTION SReadLong    (spBlkPtr: SpBlockPtr) : OSErr;
  2603. spBlkPtr    Pointer to a Slot Manager parameter block.
  2604. <symbol\>\xac     spResult    LongInt    Contents of the longword.
  2605. <symbol\>\xae     spsPointer    Ptr    Pointer to the sResource list.
  2606. <symbol\>\xae     spID    SignedByte    The ID of the sResource list entry.
  2607. 5    spSize    LongInt
  2608. 5    spOffsetData    LongInt
  2609. 5    spByteLanes    SignedByte
  2610. DESCRIPTION
  2611. The SReadLong function returns the 32-bit value pointed to by the offset field of an sResource list entry. 
  2612. You provide a pointer to the sResource list in the spsPointer field, and the ID of the entry in the spID field. The SReadLong function returns the longword value in the spResult field.
  2613. This function may alter the values of the spSize, spOffsetData, and spByteLanes fields of the parameter block. Your application should not depend on the values returned in these fields.
  2614. SPECIAL CONSIDERATIONS
  2615. The SReadLong function does not move memory; your application may call this function at interrupt time.
  2616. ASSEMBLY-LANGUAGE INFORMATION
  2617. The trap macro for the SReadLong function is _SlotManager ($A06E). The routine selector is $0002.
  2618. Trap macro        Selector
  2619. _SlotManager        $0002
  2620. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2621. Registers on entry
  2622. A0    address of the parameter block
  2623. D0    $0002
  2624. Registers on exit
  2625. D0    result code
  2626. SEE ALSO
  2627. For more information about the sResource list data structure, see the section “Firmware” on page 3-7. 
  2628. 3SGetCString
  2629. You can use the SGetCString function to determine the value of a string pointed to by the offset field of an sResource list entry. 
  2630. FUNCTION SGetCString    (spBlkPtr: SpBlockPtr) : OSErr;
  2631. spBlkPtr    Pointer to a Slot Manager parameter block.
  2632. <symbol\>\xac     spResult    LongInt    Pointer to copy of cString.
  2633. <symbol\>\xae     spsPointer    Ptr    Pointer to the sResource list.
  2634. <symbol\>\xae     spID    SignedByte    The ID of the sResource list entry.
  2635. 5    spSize    LongInt
  2636. 5    spOffsetData    LongInt
  2637. 5    spByteLanes    SignedByte
  2638. 5    spFlags    SignedByte
  2639. DESCRIPTION
  2640. The SGetCString function returns a copy of the cString data structure pointed to by the offset field of an sResource list entry. 
  2641. You provide a pointer to the sResource list in the spsPointer field, and the ID of the entry in the spID field. 
  2642. The SGetCString function allocates a memory buffer, copies the value of the cString data structure into it, and returns a pointer to it in the spResult field. You should dispose of this pointer using the Memory Manager routine DisposPtr.
  2643. This function may alter the values of the spSize, spOffsetData, spByteLanes, and spFlags fields of the parameter block. Your application should not depend on the values returned in these fields.
  2644. SPECIAL CONSIDERATIONS
  2645. The SGetCString function allocates memory; your application should not call this function at interrupt time.
  2646. ASSEMBLY-LANGUAGE INFORMATION
  2647. The trap macro for the SGetCString function is _SlotManager ($A06E). The routine selector is $0003.
  2648. Trap macro        Selector
  2649. _SlotManager        $0003
  2650. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2651. Registers on entry
  2652. A0    address of the parameter block
  2653. D0    $0003
  2654. Registers on exit
  2655. D0    result code
  2656. SEE ALSO
  2657. For more information about the cString data structure, see the section “Firmware” on page 3-7. 
  2658. 3SGetBlock
  2659. You can use the SGetBlock function to obtain a copy of an sBlock data structure pointed to by the offset field of an sResource list entry. 
  2660. FUNCTION SGetBlock    (spBlkPtr: SpBlockPtr) : OSErr;
  2661. spBlkPtr    Pointer to a Slot Manager parameter block.
  2662. <symbol\>\xac     spResult    LongInt    Pointer to copy of sBlock.
  2663. <symbol\>\xae     spsPointer    Ptr    Pointer to the sResource list.
  2664. <symbol\>\xae     spID    SignedByte    The ID of the sResource list entry.
  2665. 5    spSize    LongInt
  2666. 5    spOffsetData    LongInt
  2667. 5    spByteLanes    SignedByte
  2668. 5    spFlags    SignedByte
  2669. DESCRIPTION
  2670. The SGetBlock function returns a copy of the sBlock data structure pointed to by the offset field of an sResource list entry. 
  2671. You provide a pointer to the sResource list in the spsPointer field, and the ID of the entry in the spID field. 
  2672. The SGetBlock function allocates a memory buffer, copies the contents of the sBlock data structure into it, and returns a pointer to it in the spResult field. You should dispose of this pointer using the Memory Manager routine DisposPtr.
  2673. This function may alter the values of the spSize, spOffsetData, spByteLanes, and spFlags fields of the parameter block. Your application should not depend on the values returned in these fields.
  2674. SPECIAL CONSIDERATIONS
  2675. The SGetBlock function allocates memory; your application should not call this function at interrupt time.
  2676. ASSEMBLY-LANGUAGE INFORMATION
  2677. The trap macro for the SGetBlock function is _SlotManager ($A06E). The routine selector is $0005.
  2678. Trap macro        Selector
  2679. _SlotManager        $0005
  2680. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2681. Registers on entry
  2682. A0    address of the parameter block
  2683. D0    $0005
  2684. Registers on exit
  2685. D0    result code
  2686. SEE ALSO
  2687. For more information about the sBlock data structure, see the section “Firmware” on page 3-7. 
  2688. For information on how to determine the size of an sBlock data structure, see the next section, which describes the SReadPBSize function.
  2689. 3SReadPBSize
  2690. You can use the SReadPBSize function to determine the size of an sBlock data structure.
  2691. FUNCTION SReadPBSize    (spBlkPtr: SpBlockPtr) : OSErr;
  2692. spBlkPtr    Pointer to a Slot Manager parameter block.
  2693. <symbol\>\xab     spsPointer    Ptr    Pointer to sResource list.
  2694. <symbol\>\xac     spSize    LongInt    Size of the sBlock data structure.
  2695. <symbol\>\xab     spsPointer    Ptr    Pointer to sResource lists.
  2696. <symbol\>\xae     spID    SignedByte    ID of the sBlock in the sResource list.
  2697. <symbol\>\xac     spByteLanes    SignedByte    Byte lanes from format block.
  2698. <symbol\>\xae     spFlags    SignedByte    Additional flags.
  2699. 5    spResult    LongInt
  2700. DESCRIPTION
  2701. You provide a pointer to the sResource list in the spsPointer field and the ID of the sBlock entry in the spID field. You can also specify the fckReserved flag of the spFlags field.
  2702. The SReadPBSize function returns the physical size of the block in the spSize field and a pointer to the block in the spsPointer field.
  2703. This function uses the spByteLanes field to return the value of the ByteLanes field from the format block of the card on which the sResource data structure resides. 
  2704. SPECIAL CONSIDERATIONS
  2705. The SReadPBSize function does not move memory; your application may call this function at interrupt time.
  2706. ASSEMBLY-LANGUAGE INFORMATION
  2707. The trap macro for the SReadPBSize function is _SlotManager ($A06E). The routine selector is $0026.
  2708. Trap macro        Selector
  2709. _SlotManager        $0026
  2710. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2711. Registers on entry
  2712. A0    address of the parameter block
  2713. D0    $00026
  2714. Registers on exit
  2715. D0    result code
  2716. SEE ALSO
  2717. For more information about the sBlock data structure, see the section “Firmware” on page 3-7. 
  2718. 3SFindStruct
  2719. The SFindStruct function allows you to obtain a pointer to any data structure pointed to by the offset field of an sResource list entry. You might want to use this function, for example, when the data structure type is defined by the card designer.
  2720. FUNCTION SFindStruct    (spBlkPtr: SpBlockPtr) : OSErr;
  2721. spBlkPtr    Pointer to a Slot Manager parameter block.
  2722. <symbol\>\xab     spsPointer    Ptr    On input: pointer to the sResource list.
  2723. On output: pointer to data structure.
  2724. <symbol\>\xae     spID    SignedByte    The ID of the sResource list entry.
  2725. 5    spByteLanes    SignedByte
  2726. DESCRIPTION
  2727. You provide a pointer to the sResource list in the spsPointer field, and the ID of the entry in the spID field. 
  2728. The SFindStruct function returns a pointer to the data structure in the spResult field. 
  2729. This function may alter the value of the spByteLanes field of the parameter block. Your application should not depend on the value returned in this field.
  2730. SPECIAL CONSIDERATIONS
  2731. The SFindStruct function does not move memory; your application may call this function at interrupt time.
  2732. ASSEMBLY-LANGUAGE INFORMATION
  2733. The trap macro for the SFindStruct function is _SlotManager ($A06E). The routine selector is $0006.
  2734. Trap macro        Selector
  2735. _SlotManager        $0006
  2736. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2737. Registers on entry
  2738. A0    address of the parameter block
  2739. D0    $0006
  2740. Registers on exit
  2741. D0    result code
  2742. SEE ALSO
  2743. For more information about the sResource list data structure, see the section “Firmware” on page 3-7. 
  2744. For information about obtaining a copy of a data structure pointed to by the offset field of an sResource list entry, rather than a pointer to the data structure, see the next section, which describes the SReadStruct function.
  2745. 3SReadStruct
  2746. The SReadStruct function allows you obtain a copy of any data structure offset from an sResource list entry. You might want to use this function, for example, when the data structure type is defined by the card designer.
  2747. FUNCTION SReadStruct    (spBlkPtr: SpBlockPtr) : OSErr;
  2748. spBlkPtr    Pointer to a Slot Manager parameter block.
  2749. You specify values and receive return values in the Slot Manager parameter block.
  2750. <symbol\>\xae     spResult    LongInt    Pointer to memory block.
  2751. <symbol\>\xae     spsPointer    Ptr    Pointer to the structure.
  2752. <symbol\>\xae     spSize    LongInt    The length in bytes of the structure.
  2753. 5    spByteLanes    SignedByte
  2754. DESCRIPTION
  2755. The SReadStruct function copies any arbitrary data structure from the declaration ROM of an expansion card into memory.
  2756. You provide a pointer to the structure in the spsPointer field and the size of the structure in the spSize field. You must also allocate a memory block for the result and send a pointer to it in the spResult field.
  2757. The SReadStruct function copies the data structure into the memory block pointed to by the spResult field.
  2758. This function may alter the value of the spByteLanes field of the parameter block. Your application should not depend on the value returned in this field.
  2759. SPECIAL CONSIDERATIONS
  2760. The SReadStruct function does not move memory; your application may call this function at interrupt time.
  2761. ASSEMBLY-LANGUAGE INFORMATION
  2762. The trap macro for the SReadStruct function is _SlotManager ($A06E). The routine selector is $0007.
  2763. Trap macro        Selector
  2764. _SlotManager        $0007
  2765. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2766. Registers on entry
  2767. A0    address of the parameter block
  2768. D0    $0007
  2769. Registers on exit
  2770. D0    result code
  2771. SEE ALSO
  2772. For more information about the sResource list data structure, see the section “Firmware” on page 3-7. 
  2773. For information about obtaining a pointer to a data structure pointed to by the offset field of an sResource list entry, rather than a copy of the data structure, see the previous section, which describes the SFindStruct function.
  2774. Loading Drivers and Executing Code from sResource 
  2775. Data Structures
  2776. The routines in this section allow you to load the device driver associated with an sResource data structure or execute code from an SExecBlock data structure.
  2777. Both of the routines in this section require you to provide extra information in an SEBlock, or SExec parameter block, data structure, shown in Listing 3-5.
  2778. SEBlock (sExec parameter block) data structure
  2779. SEBlockPtr                            =    ^SEBlock;
  2780.  
  2781. SEBlock                            =    PACKED RECORD
  2782.                 seSlot:                    SignedByte;                    {Slot number}
  2783.                 sesRsrcID:                    SignedByte;                    {sResource ID}
  2784.                 seStatus:                    INTEGER;                    {Status of sExecBlock code}
  2785.                 seFlags:                    SignedByte;                    {Flags}
  2786.                 seFiller0:                    SignedByte;                    {Used for word alignment}
  2787.                 seFiller1:                    SignedByte;                    {Used for word alignment}
  2788.                 seFiller2:                    SignedByte;                    {Used for word alignment}
  2789.                 seResult:                    LONGINT;                    {Result of SLoad}
  2790.                 seIOFileName:                    LONGINT;                    {Pointer to IOFile name}
  2791.                 seDevice:                    SignedByte;                    {Which device to read from}
  2792.                 sePartition:                    SignedByte;                    {The partition}
  2793.                 seOSType:                    SignedByte;                    {Type of OS}
  2794.                 seReserved:                    SignedByte;                    {Reserved}
  2795.                 seRefNum:                    SignedByte;                    {Driver reference number}
  2796.                 seNumDevices:                    SignedByte;                    {Number of devices to load}
  2797.                 seBootState:                    SignedByte;                    {State of StartBoot code}
  2798. END;
  2799. 3SGetDriver
  2800. You can use the SGetDriver function to load an sResource data structure’s device driver.
  2801. FUNCTION SGetDriver    (spBlkPtr: SpBlockPtr) : OSErr;
  2802. spBlkPtr    Pointer to a Slot Manager parameter block.
  2803. <symbol\>\xac     spResult    LongInt    Pointer to memory block.
  2804. <symbol\>\xae     spsExecPBlk    Ptr    Pointer to SEblock.
  2805. <symbol\>\xae     spSlot    SignedByte    The slot number.
  2806. <symbol\>\xae     spID    SignedByte    The sResource ID.
  2807. <symbol\>\xae     spExtDev    SignedByte    The external device ID.
  2808. 5    spSize    SignedByte
  2809. 5    spFlags    SignedByte
  2810. DESCRIPTION
  2811. The SGetDriver function loads a device driver from an sResource data structure into memory.
  2812. You specify an sResource data structure with the spSlot, spID, and D fields, and provide a pointer to an SExecBlock in the spsExecPBlk field.
  2813. The SGetDriver function searches the sResource list for an sRsrcLoadRec entry. If it finds one, it loads the sLoadDriver record and executes it. If no sRsrcLoadRec entry exists, the SGetDriver function looks for an sRsrcDrvrDir entry. If it finds one, it loads the driver into memory.
  2814. The SGetDriver function returns a handle to the driver in the spResult field of the parameter block.
  2815. SPECIAL CONSIDERATIONS
  2816. The SGetDriver function may move memory; your application should not call this function at interrupt time.
  2817. ASSEMBLY-LANGUAGE INFORMATION
  2818. The trap macro for the SGetDriver function is _SlotManager ($A06E). The routine selector is $002D.
  2819. Trap macro        Selector
  2820. _SlotManager        $002D
  2821. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register A0 contains a handle to the loaded driver and register D0 contains the result code.
  2822. Registers on entry
  2823. A0    address of the parameter block
  2824. D0    $002D
  2825. Registers on exit
  2826. A0    handle to loaded driver
  2827. D0    result code
  2828. SEE ALSO
  2829. For more information about the sResource data structure, including the sRsrcDrvrDir and sRsrcLoadRec entry types, see Designing Cards and Drivers for the Macintosh Family. 
  2830. 3SExec
  2831. You can use the SExec function to execute code stored in an sExecBlock data structure.
  2832. FUNCTION SExec    (spBlkPtr: SpBlockPtr) : OSErr;
  2833. spBlkPtr    Pointer to a Slot Manager parameter block.
  2834. <symbol\>\xae     spsPointer    Ptr    Pointer to sResource list.
  2835. <symbol\>\xae     spsExecPBlk    Ptr    Pointer to SEBlock data structure.
  2836. <symbol\>\xae     spID    SignedByte    ID of sExecBlock entry in sResource list.
  2837. 5    spResult    LongInt
  2838. DESCRIPTION
  2839. The SExec function loads SExecBlock code from an sResource list into the current heap zone, checks its revision level and CRC field, and executes the code.
  2840. You specify the SExecBlock by providing a pointer to the sResource list in the spsPointer field and the ID of the SExecBlock entry in the spID field. You must also provide in the spsExecPBlk field a pointer to an SExec parameter block. This data structure, shown in Listing 3-5, allows you to provide information about the execution of the SExecBlock code.
  2841. The SExec function passes the sExecBlock code a pointer to this data structure in register A0.
  2842. SPECIAL CONSIDERATIONS
  2843. The SExec function may move memory; your application should not call this function at interrupt time.
  2844. ASSEMBLY-LANGUAGE INFORMATION
  2845. The trap macro for the SExec function is _SlotManager ($A06E). The routine selector is $0023.
  2846. Trap macro        Selector
  2847. _SlotManager        $0023
  2848. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2849. Registers on entry
  2850. A0    address of the parameter block
  2851. D0    $0023
  2852. Registers on exit
  2853. D0    result code
  2854. SEE ALSO
  2855. For more information about the sResource data structure and the sExecBlock data structure, see the section “Firmware” on page 3-7. 
  2856. For more information about device drivers, see the chapter “The Device Manager” of this volume.
  2857. Traversing Firmware of Expansion Cards
  2858. Because declaration ROMs may not use all four byte lanes, the difference between the addresses of two adjacent blocks may be greater than the size in bytes of the first block. The SCalcSPointer function can help you calculate the address of the next block in a declaration ROM, given a pointer to the current block and its size in bytes.
  2859. 3SCalcSPointer
  2860. You can use the SCalcSPointer function to obtain a pointer to a given byte in a card’s declaration ROM.
  2861. FUNCTION SCalcSPointer    (spBlkPtr: SpBlockPtr) : OSErr;
  2862. spBlkPtr    Pointer to a Slot Manager parameter block.
  2863. <symbol\>\xab     spsPointer    Ptr    Pointer to a byte in declaration ROM.
  2864. <symbol\>\xae     spOffsetData    LongInt    Offset in bytes to desired pointer.
  2865. <symbol\>\xae     spByteLanes    SignedByte    Byte lanes used.
  2866. DESCRIPTION
  2867. You specify the byte by providing a pointer to the current byte in the spsPointer field, an offset in bytes in the spOffset data field, and the valid byte lanes in the spByteLanes field.
  2868. The SCalcSPointer function returns the calculated pointer in the spsPointer field.
  2869. SPECIAL CONSIDERATIONS
  2870. The SCalcSPointer function does not move memory; your application may call this function at interrupt time.
  2871. ASSEMBLY-LANGUAGE INFORMATION
  2872. The trap macro for the SCalcSPointer function is _SlotManager ($A06E). The routine selector is $002C.
  2873. Trap macro        Selector
  2874. _SlotManager        $002C
  2875. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2876. Registers on entry
  2877. A0    address of the parameter block
  2878. D0    $002C
  2879. Registers on exit
  2880. D0    result code
  2881. SEE ALSO
  2882. For more information about the sResource list data structure, see the section “Firmware” on page 3-7. 
  2883. Getting Information about Expansion Cards and 
  2884. Declaration ROMs
  2885. The functions in this section return information about slot status, or information about entire declaration ROMs, instead of single sResource data structures.
  2886. The first two functions return information from the slot information record maintained by the Slot Manager for a particular slot. Listing 3-5 shows the definition of this data type.
  2887. SEBlock (SExec parameter block) data structure
  2888. TYPE SInfoRecPtr                                     =    ^SInfoRecord;
  2889.  
  2890.                 SInfoRecord                 =    PACKED RECORD
  2891.                     siDirPtr:                    Ptr;                 {pointer to sResource directory}
  2892.                     siInitStatusA:                    INTEGER;                 {initialization error}
  2893.                     siInitStatusV:                    INTEGER;                 {status returned by vendor} 
  2894.                                                          {    initialization routine}
  2895.                     siState:                    SignedByte;                 {initialization state}
  2896.                     siCPUByteLanes:                    SignedByte;                 {byte lanes used}
  2897.                     siTopOfROM:                    SignedByte;                 {highest valid address in ROM}
  2898.                     siStatusFlags:                    SignedByte            ;     {bit 0 is CardIsChanged flag}
  2899.                     siTOConstant:                    INTEGER;                 {Timeout constant for bus error}
  2900.                     siReserved:                    SignedByte;                 {reserved}
  2901.             END;
  2902. 3SFindSInfoRecPtr
  2903. You can use the SFindSInfoRecPtr function to obtain a pointer to the SInfoRecord data structure for a particular slot.
  2904. FUNCTION SFindSInfoRecPtr    (spBlkPtr: SpBlockPtr) : OSErr;
  2905. spBlkPtr    Pointer to a Slot Manager parameter block.
  2906. <symbol\>\xac     spResult    LongInt    Pointer to the SInfoRecord data structure.
  2907. <symbol\>\xae     spSlot    SignedByte    The slot number.
  2908. DESCRIPTION
  2909. You specify the slot with the spSlot parameter. You must also allocate an sInfoRecord data structure, and provide a pointer to it in the spResult field. 
  2910. The SFindSInfoRecPtr function returns in the spResult field a pointer to the sInfoRecord data structure for the specified slot.
  2911. SPECIAL CONSIDERATIONS
  2912. The SFindSInfoRecPtr function does not move memory; your application may call this function at interrupt time.
  2913. ASSEMBLY-LANGUAGE INFORMATION
  2914. The trap macro for the SFindSInfoRecPtr function is _SlotManager ($A06E). The routine selector is $002F.
  2915. Trap macro        Selector
  2916. _SlotManager        $002F
  2917. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2918. Registers on entry
  2919. A0    address of the parameter block
  2920. D0    $002F
  2921. Registers on exit
  2922. D0    result code
  2923. SEE ALSO
  2924. For general information about the SInfoRecord data structure, see “About the Slot Manager” on page 3-12.
  2925. To obtain a copy of the SInfoRecord data structure, instead of a pointer to it, see the next section, which describes the SReadInfo function.
  2926. 3SReadInfo
  2927. You can use the SReadInfo function to obtain a copy of the SInfoRecord data structure for a particular slot.
  2928. FUNCTION SReadInfo    (spBlkPtr: SpBlockPtr) : OSErr;
  2929. spBlkPtr    Pointer to a Slot Manager parameter block.
  2930. <symbol\>\xae     spResult    LongInt    Pointer to an SInfoRecord data structure.
  2931. <symbol\>\xae     spSlot    SignedByte    The slot number.
  2932. <zapf\>5    spSize    LongInt    
  2933. DESCRIPTION
  2934. The Slot Manager maintains an SInfoRecord data structure for each slot. The SReadInfo function copies the information from this data structure for the requested slot.
  2935. You specify the slot with the spSlot parameter. You must also allocate an SInfoRecord data structure, and provide a pointer to it in the spResult field. The SReadInfo function copies the information in the sInfo record maintained by the Slot Manager into the data structure pointed to by the spResult field.
  2936. This function may alter the contents of the spSize field. Your application should not depend on the value returned in this field.
  2937. SPECIAL CONSIDERATIONS
  2938. The SReadInfo function does not move memory; your application may call this function at interrupt time.
  2939. ASSEMBLY-LANGUAGE INFORMATION
  2940. The trap macro for the SReadInfo function is _SlotManager ($A06E). The routine selector is $0010.
  2941. Trap macro        Selector
  2942. _SlotManager        $0010
  2943. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2944. Registers on entry
  2945. A0    address of the parameter block
  2946. D0    $0010
  2947. Registers on exit
  2948. D0    result code
  2949. SEE ALSO
  2950. For general information about sInfoRecord data structures, see the “About the Slot Manager” section.
  2951. To obtain a pointer of the SInfoRecord data structure, instead of a copy of it, see the next section, which describes the SReadInfo function.
  2952. 3SReadFHeader
  2953. You can use the SReadFHeader function to obtain a copy of the information in the format block of a declaration ROM.
  2954. FUNCTION SReadFHeader    (spBlkPtr: SpBlockPtr) : OSErr;
  2955. spBlkPtr    Pointer to a Slot Manager parameter block.
  2956. <symbol\>\xae     spResult    LongInt    Pointer to an FHeaderRec data structure.
  2957. <symbol\>\xae     spSlot    SignedByte    Slot number.
  2958. <zapf\>5    spsPointer    Ptr    
  2959. <zapf\>5    spSize    LongInt    
  2960. <zapf\>5    spOffsetData    LongInt    
  2961. <zapf\>5    spByteLanes    SignedByte    
  2962. DESCRIPTION
  2963. The SReadFHeader function copies the information from the format block of the expansion card in the requested slot to an FHeaderRec data structure you provide.
  2964. You specify the slot with the spSlot parameter. You must also allocate an FHeaderRec data structure, defined in Listing 3-7, and provide a pointer to it in the spResult field. 
  2965. The SReadInfo function copies the information in the format block into the data structure pointed to by the spResult field.
  2966. This function may alter the contents of the spsPointer, spSize, spOffsetData, and spByteLanes fields. Your application should not depend on the values returned in these fields.
  2967. The FHeaderRec data structure
  2968. TYPE FHeaderRecPtr = ^FHeaderRec;
  2969. FHeaderRec = PACKED RECORD
  2970.                 fhDirOffset:                    LongInt;                {offset to sResource directory}
  2971.                 fhLength:                    LongInt;                {length in bytes of declaration ROM}
  2972.                 fhCRC:                    LongInt;                {cyclic redundancy check}
  2973.                 fhROMRev:                    SignedByte;                {declaration ROM revision}
  2974.                 fhFormat:                    SignedByte;                {declaration ROM format}
  2975.                 fhTstPat:                    LongInt;                {test pattern}
  2976.                 fhReserved:                    INTEGER;                {reserved, should be $00}
  2977.                 fhByteLanes:                    SignedByte;                {byte lanes used by declaration ROM}
  2978. END;
  2979. These fields correspond to fields of the format header, described in Designing Cards and Drivers for the Macintosh Family.
  2980. SPECIAL CONSIDERATIONS
  2981. The SReadFHeader function does not move memory; your application may call this function at interrupt time.
  2982. ASSEMBLY-LANGUAGE INFORMATION
  2983. The trap macro for the SReadFHeader function is _SlotManager ($A06E). The routine selector is $0013.
  2984. Trap macro        Selector
  2985. _SlotManager        $0013
  2986. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  2987. Registers on entry
  2988. A0    address of the parameter block
  2989. D0    $0013
  2990. Registers on exit
  2991. D0    result code
  2992. SEE ALSO
  2993. For general information about the format block, see the section “Firmware” on page 3-7. 
  2994. For information about the fields of the format block, see Designing Cards and Drivers for the Macintosh Family.
  2995. 3SCkCardStat
  2996. You can use the SCkCardStat function to check the initialization status of an expansion card.
  2997. FUNCTION SCkCardStat    (spBlkPtr: SpBlockPtr) : OSErr;
  2998. spBlkPtr    Pointer to a Slot Manager parameter block.
  2999. <symbol\>\xae     spSlot    SignedByte    The slot number.
  3000. <zapf\>5    spResult    LongInt    
  3001. DESCRIPTION
  3002. The SCkCardStat function checks the InitStatusA field of the SInfoRecord data structure for the expansion card in the designated slot.
  3003. You specify the slot with the spSlot parameter. 
  3004. The SCkCardStat function returns the noErr constant if the InitStatusA field contains a nonzero value.
  3005. This function may alter the contents of the spResult field. Your application should not depend on the values returned in this field.
  3006. SPECIAL CONSIDERATIONS
  3007. The SCkCardStat function does not move memory; your application may call this function at interrupt time.
  3008. ASSEMBLY-LANGUAGE INFORMATION
  3009. The trap macro for the SCkCardStat function is _SlotManager ($A06E). The routine selector is $0018.
  3010. Trap macro        Selector
  3011. _SlotManager        $0018
  3012. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  3013. Registers on entry
  3014. A0    address of the parameter block
  3015. D0    $0018
  3016. Registers on exit
  3017. D0    result code
  3018. SEE ALSO
  3019. For more information about the SInfoRecord data type, see “Getting Information about Expansion Cards and Declaration ROMs” on page 3-58.
  3020. 3SCardChanged
  3021. You can use the SCardChanged function to determine if the card in a particular slot has been changed.
  3022. FUNCTION SCardChanged    (spBlkPtr: SpBlockPtr) : OSErr;
  3023. spBlkPtr    Pointer to a Slot Manager parameter block.
  3024. <symbol\>\xae     spSlot    SignedByte    The slot number.
  3025. <symbol\>\xac     spResult    LongInt        Boolean signifying whether card changed.
  3026. DESCRIPTION
  3027. The SCardChanged function checks if the expansion card in a slot has been changed—that is, if its sPRAMInit record has been initialized.
  3028. You specify the slot with the spSlot parameter. 
  3029. The SCardChanged function returns a value of TRUE in the spResult field of the parameter block if the card has changed.
  3030. SPECIAL CONSIDERATIONS
  3031. The SCardChanged function does not move memory; your application may call this function at interrupt time.
  3032. ASSEMBLY-LANGUAGE INFORMATION
  3033. The trap macro for the SCardChanged function is _SlotManager ($A06E). The routine selector is $0022.
  3034. Trap macro        Selector
  3035. _SlotManager        $0022
  3036. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  3037. Registers on entry
  3038. A0    address of the parameter block
  3039. D0    $0022
  3040. Registers on exit
  3041. D0    result code
  3042. SEE ALSO
  3043. For more information about the SPRAMInit record, see the next section, “Getting Access to Expansion Cards’ Parameter RAM.”
  3044. Getting Access to Expansion Cards’ Parameter RAM
  3045. The Operating System reserves six bytes of parameter RAM for each slot. The routines in this section allow you to read or change the value of these bytes.
  3046. Both of the functions in this section use the SPRAMRecord data structure to contain the parameter RAM values.
  3047. The SPRAM Record data type
  3048. TYPE SPRAMRecPtr = ^SPRAMRecord;
  3049. SPRAMRecord = PACKED RECORD
  3050.                 boardID:                INTEGER;                    {Apple-defined card ID}
  3051.                 vendorUse1:                SignedByte;                    {Reserved for vendor use}
  3052.                 vendorUse2:                SignedByte;                    {Reserved for vendor use}
  3053.                 vendorUse3:                SignedByte;                    {Reserved for vendor use}
  3054.                 vendorUse4:                SignedByte;                    {Reserved for vendor use}
  3055.                 vendorUse5:                SignedByte;                    {Reserved for vendor use}
  3056.                 vendorUse6:                SignedByte;                    {Reserved for vendor use}
  3057. END;
  3058. This data structure includes the Apple-defined BoardID and six bytes of parameter RAM information.
  3059. 3SReadPRAMRec
  3060. You can use the SReadPRAMRec function to read the parameter RAM information for a particular slot.
  3061. FUNCTION SReadPRAMRec    (spBlkPtr: SpBlockPtr) : OSErr;
  3062. spBlkPtr    Pointer to a Slot Manager parameter block.
  3063. <symbol\>\xae     spSlot    SignedByte    The slot number.
  3064. <symbol\>\xae     spResult    LongInt        Pointer to SPRAMRecord data structure.
  3065. <zapf\>5    spSize    LongInt    
  3066. DESCRIPTION
  3067. The Operating System allocates one SPRAMRecord data structure for each slot in the system parameter RAM. The Slot Manager routine InitSPRAMRecs initializes this structure with the data from the sPRAMInit record on the firmware of the expansion card. The SReadPRAMRec function provides a copy of this information to your application.
  3068. You specify the slot number in the spSlot field. You must also allocate a SPRAMRecord data structure and send a pointer to it in the spResult field. The SReadPRAMRec function copies the appropriate parameter RAM information into this data structure.
  3069. SPECIAL CONSIDERATIONS
  3070. The SReadPRAMRec function does not move memory; your application may call this function at interrupt time.
  3071. ASSEMBLY-LANGUAGE INFORMATION
  3072. The trap macro for the SReadPRAMRec function is _SlotManager ($A06E). The routine selector is $0011.
  3073. Trap macro        Selector
  3074. _SlotManager        $0011
  3075. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  3076. Registers on entry
  3077. A0    address of the parameter block
  3078. D0    $0011
  3079. Registers on exit
  3080. D0    result code
  3081. SEE ALSO
  3082. For more information about the sPRAMInit record, see Designing Cards and Drivers for the Macintosh Family.
  3083. 3SPutPRAMRec
  3084. You can use the SPutPRAMRec function to change the values stored in a slot’s parameter RAM.
  3085. FUNCTION SPutPRAMRec    (spBlkPtr: SpBlockPtr) : OSErr;
  3086. spBlkPtr    Pointer to a Slot Manager parameter block.
  3087. <symbol\>\xae     spsPointer    Ptr    Pointer to SPRAMRecord data structure.
  3088. <symbol\>\xae     spSlot    SignedByte    The slot number.
  3089. DESCRIPTION
  3090. The SPutPRAMRec function allows you to change the values stored in the parameter RAM of a slot.
  3091. You specify the slot number with the spSlot field and provide the new parameter RAM values in a SPRAMRecord data structure pointed to by the spsPointer field.
  3092. The SPutPRAMRec function copies the information from the six vendor-use fields into the parameter RAM for the slot. This function does not copy the boardID field, which is Apple-defined.
  3093. SPECIAL CONSIDERATIONS
  3094. The SPutPRAMRec function does not move memory; your application may call this function at interrupt time.
  3095. ASSEMBLY-LANGUAGE INFORMATION
  3096. The trap macro for the SPutPRAMRec function is _SlotManager ($A06E). The routine selector is $0012.
  3097. Trap macro        Selector
  3098. _SlotManager        $0012
  3099. You must setup register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
  3100. Registers on entry
  3101. A0    address of the parameter block
  3102. D0    $0012
  3103. Registers on exit
  3104. D0    result code
  3105. SEE ALSO
  3106. For more information about the sPRAMInit record, see the “Introduction to Cards and Slots” section at the beginning of this chapter.
  3107. Summary of the Slot Manager
  3108. Data Types
  3109. TYPE SpBlockPtr = ^SpBlock;
  3110.     SpBlock = PACKED RECORD
  3111.             spResult:                    LongInt;                 {result}
  3112.             spsPointer:                    Ptr;                 {structure pointer}
  3113.             spSize:                    LongInt;                 {size of structure}
  3114.             spOffsetData:                    LongInt;                 {offset or data}
  3115.             spIOFileName:                    Ptr;                 {reserved for Slot Manager}
  3116.             spsExecPBlk:                    LongInt;                 {pointer to SEBlock data structure}
  3117.             spParamData:                    Ptr;                 {flags}
  3118.             spMisc:                    LongInt;                 {reserved for Slot Manager}
  3119.             spReserved:                    LongInt;                 {reserved for Slot Manager}
  3120.             spIOReserved:                    INTEGER;                 {ioReserved field from SRT}
  3121.             spRefNum:                    INTEGER;                 {driver reference number}
  3122.             spCategory:                    INTEGER;                 {Category field of sResource type}
  3123.             spCType:                    INTEGER;                 {cType field of sResource type}
  3124.             spDrvrSW:                    INTEGER;                 {DrvrSW field of sResource type}
  3125.             spDrvrHW:                    INTEGER;                 {DrvrHW field of sResource type}
  3126.             spTBMask:                    SignedByte;                 {sResource type bit mask}
  3127.             spSlot:                    SignedByte;                 {slot number}
  3128.             spID:                    SignedByte;                 {sResource ID}
  3129.             spExtDev:                    SignedByte;                 {external device ID}
  3130.             spHwDev:                    SignedByte;                 {hardware device ID}
  3131.             spByteLanes:                    SignedByte;                 {valid byte lanes}
  3132.             spFlags:                    SignedByte;                 {flags used by Slot Manager}
  3133.             spKey:                    SignedByte;                 {reserved for Slot Manager}
  3134.     END;
  3135.     SInfoRecPtr                     =    ^SInfoRecord;
  3136.  
  3137.     SInfoRecord                 =    PACKED RECORD
  3138.             siDirPtr:                    Ptr;                 {pointer to sResource directory}
  3139.             siInitStatusA:                    INTEGER;                 {initialization error}
  3140.             siInitStatusV:                    INTEGER;                 {status returned by vendor} 
  3141.                                                  {    initialization routine}
  3142.             siState:                    SignedByte;                 {initialization state}
  3143.             siCPUByteLanes:                    SignedByte;                 {byte lanes used}
  3144.             siTopOfROM:                    SignedByte;                 {highest valid address in ROM}
  3145.             siStatusFlags:                    SignedByte            ;     {bit 0 is CardIsChanged flag}
  3146.             siTOConstant:                    INTEGER;                 {Timeout constant for bus error}
  3147.             siReserved:                    SignedByte;                 {reserved}
  3148.     END;
  3149.     FHeaderRecPtr = ^FHeaderRec;
  3150.  
  3151.     FHeaderRec = PACKED RECORD
  3152.             fhDirOffset:                    LongInt;                {offset to sResource directory}
  3153.             fhLength:                    LongInt;                {length in bytes of declaration ROM}
  3154.             fhCRC:                    LongInt;                {cyclic redundancy check}
  3155.             fhROMRev:                    SignedByte;                {declaration ROM revision}
  3156.             fhFormat:                    SignedByte;                {declaration ROM format}
  3157.             fhTstPat:                    LongInt;                {test pattern}
  3158.             fhReserved:                    INTEGER;                {reserved, should be $00}
  3159.             fhByteLanes:                    SignedByte;                {byte lanes used by declaration ROM}
  3160.     END;
  3161.     SPRAMRecPtr = ^SPRAMRecord;
  3162.  
  3163.     SPRAMRecord = PACKED RECORD
  3164.             boardID:                INTEGER;                    {Apple-defined card ID}
  3165.             vendorUse1:                SignedByte;                    {Reserved for vendor use}
  3166.             vendorUse2:                SignedByte;                    {Reserved for vendor use}
  3167.             vendorUse3:                SignedByte;                    {Reserved for vendor use}
  3168.             vendorUse4:                SignedByte;                    {Reserved for vendor use}
  3169.             vendorUse5:                SignedByte;                    {Reserved for vendor use}
  3170.             vendorUse6:                SignedByte;                    {Reserved for vendor use}
  3171.     END;
  3172. Routines
  3173. Determining the Version of the Slot Manager
  3174. FUNCTION SVersion    (spBlkPtr: SpBlockPtr) : OSErr;
  3175. Finding sResource Data Structures
  3176. FUNCTION SFindSRsrcPtr    (spBlkPtr: SpBlockPtr) : OSErr;
  3177. FUNCTION SGetSRsrcPtr    (spBlkPtr: SpBlockPtr) : OSErr;
  3178. FUNCTION SRsrcInfo    (spBlkPtr: SpBlockPtr) : OSErr;
  3179. FUNCTION SNextSRsrc    (spBlkPtr: SpBlockPtr) : OSErr;
  3180. FUNCTION SGetSRsrc    (spBlkPtr: SpBlockPtr) : OSErr;
  3181. FUNCTION SNextTypeSRsrc    (spBlkPtr: SpBlockPtr) : OSErr;
  3182. FUNCTION SGetTypeSRsrc    (spBlkPtr: SpBlockPtr) : OSErr;
  3183. Enabling, Disabling, and Restoring sResource Data Structures
  3184. FUNCTION SetSRsrcState    (spBlkPtr: SpBlockPtr) : OSErr;
  3185. FUNCTION SDeleteSRTRec    (spBlkPtr: SpBlockPtr) : OSErr;
  3186. FUNCTION InsertSRTRec    (spBlkPtr: SpBlockPtr) : OSErr;
  3187. Getting Information from sResource Data Structures
  3188. FUNCTION SReadDrvrName    (spBlkPtr: SpBlockPtr) : OSErr;
  3189. FUNCTION SOffsetData    (spBlkPtr: SpBlockPtr) : OSErr;
  3190. FUNCTION SReadByte    (spBlkPtr: SpBlockPtr) : OSErr;
  3191. FUNCTION SReadWord    (spBlkPtr: SpBlockPtr) : OSErr;
  3192. FUNCTION SReadLong    (spBlkPtr: SpBlockPtr) : OSErr;
  3193. FUNCTION SGetCString    (spBlkPtr: SpBlockPtr) : OSErr;
  3194. FUNCTION SGetBlock    (spBlkPtr: SpBlockPtr) : OSErr;
  3195. FUNCTION SReadPBSize    (spBlkPtr: SpBlockPtr) : OSErr;
  3196. FUNCTION SFindStruct    (spBlkPtr: SpBlockPtr) : OSErr;
  3197. FUNCTION SReadStruct    (spBlkPtr: SpBlockPtr) : OSErr;
  3198. Loading Drivers and Executing Code from sResource Data Structures
  3199. FUNCTION SGetDriver    (spBlkPtr: SpBlockPtr) : OSErr;
  3200. FUNCTION SExec    (spBlkPtr: SpBlockPtr) : OSErr;
  3201. Traversing Firmware of Expansion Cards
  3202. FUNCTION SCalcSPtr    (spBlkPtr: SpBlockPtr) : OSErr;
  3203. Getting Information about Expansion Cards and Declaration ROMs
  3204. FUNCTION SFindSInfoRec    (spBlkPtr: SpBlockPtr) : OSErr;
  3205. FUNCTION SReadInfo    (spBlkPtr: SpBlockPtr) : OSErr;
  3206. FUNCTION SReadFHeader    (spBlkPtr: SpBlockPtr) : OSErr;
  3207. FUNCTION SCkCardStat    (spBlkPtr: SpBlockPtr) : OSErr;
  3208. FUNCTION SCardChanged    (spBlkPtr: SpBlockPtr) : OSErr;
  3209. Getting Access to Expansion Cards’ Parameter RAM
  3210. FUNCTION SReadPRAMRec    (spBlkPtr: SpBlockPtr) : OSErr;
  3211. FUNCTION SPutPRAMRec    (spBlkPtr: SpBlockPtr) : OSErr;
  3212. ñ@ˇ ˇˇˇˇ@
  3213. ˇ·ˇ‚7^, Palatino
  3214. .Ä(*
  3215. 4^Hÿ
  3216. ˇˇ≥>ˇ◊°dONLNdƒHÂ.(›HInside Macintosh:
  3217. H    4H     H
  3218. ˇ·ˇ‚7^°dONLNd‰H≠* Devices
  3219. à∫ÿ4à∫ÿ4üªË
  3220. °dONLNdˇˇ(ߪPreliminary Draft
  3221. ∂ª‘4∂ª”4πª–l
  3222.     °dONLNdˇˇ* Developer TÎ@°dONLNdˇˇ)0echnical Publications°dONLNdˇˇ(Àª© $P°dONLNdˇˇ)    Apple ComputerZ†°dONLNdˇˇ)C , Inc. 1992
  3223. à∫ÿ
  3224. ÄQ°dONLNdˇˇ(öªˇ™@ˇ ˇˇˇˇ@
  3225. ˇ·ˇ‚7^
  3226. 4⁄`˙º4^*¿∫, Palatino
  3227. .°dONLNd\*h1+*ee‡°dONLNd\2hï)Apple Computer, Inc. °dONLNdz*Ü≠(É*© 1991, Apple Computer, Inc.°dONLNd5Ñ*ê*
  3228. All rights reserved.°dONLNdJì*ü±* Printed in the United States of °dONLNdkù*©R*
  3229. America.°dONLNdt¨*∏±*The Apple logo is a registered °dONLNdì∂*¬∂*
  3230. trademark of Apple Computer, °dONLNd∞¿*â*
  3231. Inc. Use of the “keyboard” °dONLNdà*÷∏*
  3232.  Apple logo (Option-Shift-K) for °dONLNdÏ‘*‡∞*
  3233. commercial purposes without °dONLNdfi*Í•*
  3234. the prior written consent of ˇˇN∑°dONLNd&Ë*Ùπ*
  3235. Apple may constitute trademark °dONLNdEÚ*˛∏*
  3236. infringement and unfair compe-°dONLNdc¸*π*
  3237. #tition in violation of federal and °dONLNdÜ*X*
  3238. state laws.°dONLNdí*!ç*Apple Computer, Inc. °dONLNd®*+í*
  3239. 20525 Mariani Avenue  °dONLNdø)*5†*
  3240. Cupertino, CA  95014-6299°dONLNdŸ3*?g*
  3241. 408-996-1010  °dONLNdËB*N≥*Apple, the Apple logo, APDA, °dONLNdL*Xò*
  3242. AppleLink, AppleShare, °dONLNdV*bÇ*
  3243. AppleTalk, Apple II
  3244. P@°dONLNd0XÉaå)YGS
  3245. ù°dONLNd2Vçb≥)
  3246. , A/UX, °dONLNd:`*l≤(i*EtherTalk, HyperCard, Hyper-°dONLNdVj*vπ*
  3247.  Talk, ImageWriter, LaserWriter, °dONLNdvt*Ä•*
  3248. LocalTalk, Mac, Macintosh, °dONLNdë~*ä∑*
  3249. MPW, MultiFinder, SANE, and °dONLNd≠à*îµ*
  3250. TokenTalk are registered trade-°dONLNdÃí*û≥*
  3251. marks of Apple Computer, Inc.°dONLNdͰ*≠©*Apple Desktop Bus, Balloon °dONLNd´*∑≥*
  3252. Help, Finder, KanjiTalk, Moof, ˇˇÁ˰dONLNd$µ*¡π*
  3253. QuickDraw, ResEdit, TrueType, °dONLNdBø*Àµ*
  3254. and Zhong-Wen Talk are trade-°dONLNd_…*’≥*
  3255. marks of Apple Computer, Inc.°dONLNd}ÿ*‰ó*Helvetica and Times are °dONLNdñ‚*Óô*
  3256. registered trademarks of °dONLNd∞Ï*¯Ç*
  3257. Linotype Company.ˇˇ%~°dONLNd¬˚*π*"ITC Zapf Dingbats is a registered °dONLNd‰*¢*
  3258. trademark of International °dONLNdˇ*ç*
  3259. Typeface Corporation.°dONLNd**∞*MacPaint is a registered trade-°dONLNd4(*4§*
  3260. mark of Claris Corporation.°dONLNdP7*C¥*NuBus is a trademark of Texas °dONLNdoA*Mb*
  3261. Instruments.°dONLNd|P*\≥*!PostScript is a registered trade-°dONLNdùZ*fô*
  3262. mark, and Illustrator is a °dONLNdπd*pØ*
  3263. trademark, of Adobe Systems °dONLNd÷n*zf*
  3264.  
  3265. Incorporated.ˇˇ3√°dONLNd‰}*âπ*"Sony is a registered trademark of °dONLNdá*ì{*
  3266. Sony Corporation.°dONLNdñ*¢∑*UNIX is a registered trademark °dONLNd7†*¨∞*
  3267. of UNIX System Laboratories, °dONLNdT™*∂:*
  3268. Inc.4^…¿YˇˇÜW°dONLNdY\…hX(e… Simultaneously published in the °dONLNdyf…r>*
  3269. United States and Canada.°dONLNdìé…öJ*(Limited Warranty on Media °dONLNd≠ò…§*
  3270. and Replacement°dONLNdΩ©…µ3*Even though Apple has °dONLNd‘≥…ø.*
  3271. reviewed this manual, û‡°dONLNdÍ≥.øP)eAPPLE ˇˇ±°dONLNdΩ……S(Δ…MAKES NO WARRANTY OR ˇ˛ùǰdONLNd«…”S*
  3272. REPRESENTATION, EITHER °dONLNd—…›;*
  3273. EXPRESS OR IMPLIED, °dONLNd0€…ÁE*
  3274. WITH RESPECT TO THIS °dONLNdEÂ…ÒE*
  3275. MANUAL, ITS QUALITY, °dONLNdZÔ…˚I*
  3276. ACCURACY, MERCHANT-°dONLNdm˘…N*
  3277. ABILITY, OR FITNESS FOR °dONLNdÖ…N*
  3278. A PARTICULAR PURPOSE. °dONLNdõ
  3279. …,*
  3280. AS A RESULT, THIS °dONLNdÆ…#<*
  3281. MANUAL IS SOLD “AS °dONLNd¬!…-C*
  3282. IS,” AND YOU, THE PUR-°dONLNdÿ+…7M*
  3283. CHASER, ARE ASSUMING °dONLNdÌ5…AF*
  3284. THE ENTIRE RISK AS TO °dONLNd?…K(*
  3285. ITS QUALITY AND °dONLNdI…U *
  3286. ACCURACY.  °dONLNd Z…fO*IN NO EVENT WILL APPLE °dONLNd7d…pC*
  3287. BE LIABLE FOR DIRECT, °dONLNdNn…z1*
  3288. INDIRECT, SPECIAL, °dONLNdbx…ÑJ*
  3289. INCIDENTAL, OR CONSE-°dONLNdwÇ…é;*
  3290. QUENTIAL DAMAGES °dONLNdâå…òB*
  3291. RESULTING FROM ANY °dONLNdùñ…¢O*
  3292. DEFECT OR INACCURACY °dONLNd≤†…¨'*
  3293. IN THIS MANUAL, {†°dONLNd¬†(¨H)_even if °dONLNd ™…∂E(≥…advised of the possibility of °dONLNdË¥…¿*
  3294. such damages.  °dONLNd¯≈…—;*THE WARRANTY AND °dONLNd    œ…€=*
  3295. REMEDIES SET FORTH °dONLNdŸ…ÂD*
  3296. ABOVE ARE EXCLUSIVE °dONLNd0„…Ô3*
  3297. AND IN LIEU OF ALL °dONLNdDÌ…˘**
  3298. OTHERS, ORAL OR °dONLNdU˜…?*
  3299. WRITTEN, EXPRESS OR °dONLNdj…
  3300. ˙*
  3301.     IMPLIED. Ó`°dONLNds˙
  3302. H)1No Apple dealer, °dONLNdÑ …)(…agent, or employee is °dONLNdõ…!4*
  3303. authorized to make any °dONLNd≥…+A*
  3304. modification, extension, or °dONLNd–)…5?*
  3305. addition to this warranty.  °dONLNdÌ:…FI*Some states do not allow the °dONLNd    
  3306. D…P:*
  3307. exclusion or limitation of °dONLNd    &N…ZO*
  3308.  implied warranties or liability °dONLNd    FX…dR*
  3309.  for incidental or consequential °dONLNd    fb…n/*
  3310. damages, so the above ˇˇpr°dONLNd    }l…xS*
  3311.  limitation or exclusion may not °dONLNd    ùv…ÇG*
  3312. apply to you. This warranty °dONLNd    πÄ…åP*
  3313. !gives you specific legal rights, °dONLNd    ⁄ä…ñK*
  3314. and you may also have other ˇˇ‘Ô°dONLNd    ˆî…†S*
  3315.  rights which vary from state to °dONLNd
  3316. û…™‡*
  3317. state.4^h¿¯ˇ@ˇ ˇˇˇˇ@
  3318. ˇ·ˇ‚7^
  3319. 4⁄∫˙,     Helvetica
  3320.     .(‡∫Contents
  3321. 
  3322. ‡(‡1ù)-‡)1
  3323. (Ô∫Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3324. 1/91(¯∫ Second line., Palatino
  3325.         (#∫CHAPTER )~1
  3326. ~H-4~H- H
  3327. °dONLNdˇˇ('∫Contents
  3328. ˇ·ˇ‚7^
  3329. ˇˇf|ˇÆ°dONLNd[∫z≈(t∫The Device Manager
  3330. °dONLNd=∫H *—Intr∑@°dONLNd= HX)oduction to Devices and Driversö†°dONLNd8=mHz)£1-3°dONLNd<J∫U1(R∫About the Device ManagerưdONLNdVJEUR)ã1-4°dONLNdZW∫b/(_∫Using the Device Manager ‡°dONLNdtWDbQ)ä1-7°dONLNdxdƒog(lƒ"Opening and Closing Device Drivers∞‡°dONLNdúd{oà)∑1-8°dONLNd†qƒ|(yƒCommunicating Wd@°dONLNdØq|h)Tith Device DriversÁİdONLNd√q||é)d1-10°dONLNd»~ƒâ›(܃ContrÂ@°dONLNdÕ~›âÉ)$olling and Monitoring Device DriversÄİdONLNdÛ~òâ™)ª1-13°dONLNd¯ã∫ñ—(ì∫Refer⁄ °dONLNd˝ã—ñK)ence to the Device Manager%†°dONLNdã`ñr)è1-15°dONLNdòƒ£Á(†ƒData Str``°dONLNd&òË£ˇ)$ucturÊ@°dONLNd+òˇ£)esχ°dONLNd/ò£.)1-15°dONLNd4•ƒ∞Î(≠ƒRoutines≠`°dONLNd>•ˇ∞);1-18°dONLNdC≤ŒΩq(∫Œ"Opening and Closing Device Drivers∞‡°dONLNdg≤ÖΩó)∑1-18°dONLNdløŒ ˛(«Œ
  3331. Reading Fr0`°dONLNdvøˇ -)1om and W©†°dONLNd~ø, M)-riting T≈†°dONLNdÜøL v)     o DevicesGİdONLNdëøã ù)?1-25°dONLNdñÃŒ◊Á(‘ŒContrÂ@°dONLNdõÃÁ◊n)olling and Monitoring Devices¿°dONLNd∫ÃÉ◊ï)ú1-31°dONLNdøŸ∫‰K(·∫Summary of the Device Managerx¿°dONLNdfiŸ`‰r)¶1-39ˇå@ˇ ˇˇˇˇ@
  3332. ˇ·ˇ‚7^
  3333. 4*\˜, Palatino
  3334. .+ú"CHAPTER œ´)\14⁄*˙¯,     Helvetica
  3335. (‡*1 )-c)2
  3336.     )iContents
  3337. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3338. 1/91(¯ú Second line.4^*¿¯ˇ“@ˇ ˇˇˇˇ@
  3339. ˇ·ˇ‚7^, Palatino
  3340. .+ä"CHAPTER 
  3341. 4⁄ä˙,     Helvetica
  3342.     (‡ä#Introduction to Devices and Drivers
  3343. 
  3344. ‡(‡1ù)-‡)3
  3345. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3346. 1/91(¯ä Second line.("È1
  3347.     ˇˇ—ÚˇÆ°dONLNd8äC⁄(@äThe Device Managerˇˇˇˇˇˇ≠>(@1
  3348. °dONLNd]ähˇ(eäSThis chapter describes how your application can use the Device Manager to transfer °dONLNdfiätΩ* Cinformation into and out of the Macintosh. The Device Manager contrA°dONLNd©iæt(qæols the exchange of °dONLNdΩuäÄC(}ä(information between applications and har°dONLNdÂuDÄ[)∫dwar9¿°dONLNdÈu[Ä‹)e devices. Often applications °dONLNdÅäåP(âä)communicate with the Device Manager indir_†°dONLNd0ÅPåd)Δectly7†°dONLNd5Ådåö), by calling rù@°dONLNdCÅöå)6outines of other managers °dONLNd]çäòü(ïä<(for example, the File Manager) which use the Device ManagerXİdONLNdôçüòÕ(ïü    . However °dONLNd¢çÃò)- , sometimes °dONLNdÆôä§;(°ä'applications must call Device Manager r5¿°dONLNd’ô<§k)≤ outines dir˛@°dONLNd‡ôk§)/ectly÷@°dONLNdÂô§Å).°dONLNdÁ´ä∂(≥äYRead the information in this chapter if your application needs to use the Device Manager °dONLNd@∑ä¬* Tto communicate with a device. For example, you might need to use the Device Manager °dONLNdî√äŒç* 6to communicate with a modem device on an expansion car °dONLNd √éŒô(Àéd. Ù@°dONLNdÕ√òŒû)
  3349. Y¥¿°dONLNdŒ√ûŒ’) ou would pr–@°dONLNdŸ√’Œ)7 obably not °dONLNd‰œä⁄(◊äUneed to use the Device Manager to communicate with a graphics device on an expansion °dONLNd9€äÊó* carµ@°dONLNd<€óÊM)
  3350. 'd, as you would use QuickDraw instead. A¿°dONLNdc€NÊT)∑Y@°dONLNdd€TÊ˚)&ou also do not need to use the Device °dONLNdäÁäÚ¡(Ôä Manager dir[ °dONLNdïÁ¡Ú)7Kectly to communicate with disk drives or printers, as you can use the File °dONLNd‡Ûä˛(˚äManager or the Printing Managerm`°dONLNdˇÛ˛ )î.°dONLNdäê(
  3351. äTµ¿°dONLNdè‹)o use this chapterw °dONLNd‹b)M, you should be familiar with rœ°dONLNd3bz)Üesour@°dONLNd8{¯)ces and how the system sear+@°dONLNdS¯
  3352. )}ches °dONLNdXäç(ärE°dONLNdYé¶)esourç@°dONLNd^¶∑)ce fiS‡°dONLNdc∏E) les. See the chapter “The ResourÁ†°dONLNdÉEõ)çce Manager” in the J†°dONLNdñú)WInside Macintosh: Macintosh °dONLNd≤ä(ê(%äT°dONLNd≥è(®)oolbox9°dONLNdπ©(œ) volume.°dONLNd¬/ä:Ë(7äThis chapter includes,
  3353.  
  3354. Zapf Dingbats
  3355. °dONLNdÿCäJè*n
  3356. °dONLNd⁄AñLƒ) a brief intr¡@°dONLNdÊAƒLé)..oduction to devices and device drivers (the prᇰdONLNdAèL›)Àograms that contr§¿°dONLNd%A›L )N ol devices)
  3357. °dONLNd1Uä\è([än
  3358. °dONLNd3Sñ^’) Fa description of the Device Manager and how it manages device drivers 
  3359. °dONLNdzgänè(män
  3360. °dONLNd|eñp[) +a discussion of how to use Device Manager rµ°dONLNdße[p)≈%outines to exchange information with °dONLNdÃqñ| (yñdevices and device drivers°dONLNdÁÉäéê(ãäY@İdONLNdËÉêéµ)ou can fi İdONLNdÒÉ∂é‡)&    nd specifiÊ¿°dONLNd˚ɇék)*c information about the standarg‡°dONLNdÉlé )å%d Macintosh device drivers, like the °dONLNd?èäö˙(óäVDisk Driver and the Serial Drivers, in separate chapters of this book. If you want to °dONLNdïõä¶í* crµ@°dONLNdóõí¶^)-eate your own device driver or desk accessory«Ä°dONLNdƒõ]¶ú)À, you should fio °dONLNd”õù¶Æ)@rst r& °dONLNdÿõض )ead this chapter and °dONLNdÌßä≤§(Øäthen rs¿°dONLNdÛß§≤˘)ead the chapter “W;İdONLNdߢ≤)Uriting Ù °dONLNd ß≤)Y¥†°dONLNd
  3361. ß≤ø)$our Own Device Driver” in this book.
  3362. ∑H“4∏H“
  3363. „HÎ4‰HΠ‰H‰
  3364. ˇ·ˇ‚7^
  3365. ˇˇ£‰ˇÆ°dONLNd2–H‚S(fiH#Introduction to Devices and Driversˇˇˇˇˇˇ⁄|(fi 1
  3366. °dONLNdVÙäˇë(¸äA∫†°dONLNdWÙëˇì) :†°dONLNdXÙ)device©†°dONLNd^Ù±ˇ)Q is a physical part of the Macintosh, or a piece of external equipment, that can °dONLNdØä (äSexchange information with applications or with the Operating System. Input devices °dONLNd ä†* ?transfer information into the Macintosh, while output devices r@†°dONLNdA °˝(°eceive information frp†°dONLNdV ˝
  3367. )\om °dONLNdYä#Õ( äthe Macintosh. ‰Ä°dONLNdhÕ#≤)C4An I/O device can transfer information in either dir °dONLNdú≤#œ)Âection.°dONLNd§*ä5c(2ä1Devices transfer information in one of two ways. `‡°dONLNd’*d5¥)⁄Character devicesü`°dONLNdÊ*¥5∫)P r‰`°dONLNdË*∫5˘)ead or write a °dONLNd˜6äAï(>ästrƒ`°dONLNd˙6ïA) Weam of characters, or bytes, one at a time; they can neither skip bytes nor go back to °dONLNd    QBäMì(JäprG °dONLNd    SBîMX)
  3368. .evious bytes. The serial ports and printers arƒ`°dONLNd    ÅBXM≠)ƒe character devices.°dONLNd    ñTä_»(\ä
  3369. Block devices˘¿°dONLNd    £T»_Œ)> r>¿°dONLNd    •Tœ_#)ead and write entirZ°dONLNd    ∏T#_œ)T)e blocks of bytes at one time; they can r˝°dONLNd    ·Tœ_)¨
  3370. ead or write °dONLNd    Ó`äke(hä0any accessible block on demand. These devices ark °dONLNd
  3371. `ek√)€e usually used to stor{ °dONLNd
  3372. 4`√k·)^e and rˆ‡°dONLNd
  3373. ;`·k)etrieve °dONLNd
  3374. Cläw(täinformation. Disk drives ar¿°dONLNd
  3375. ^lwG)xe block devices.°dONLNd
  3376. o~äâ÷(ÜäGDevices communicate with applications and with the Operating System thr¶°dONLNd
  3377. ∂~÷â(Ü÷
  3378. ough special °dONLNd
  3379. √ääïì(íäprG °dONLNd
  3380. ≈äîï‘)
  3381. ograms called u¿°dONLNd
  3382. ”ä‘ï)@device driversõ°dONLNd
  3383. ·äï˙)@6. These drivers act as translators, converting softwarÄ °dONLNd ä˙ï)Êe °dONLNd ñä°ç(ûärE°dONLNd ñé°‘)equests into har<‡°dONLNd *ñ‘°Î)Fdwart†°dONLNd .ñΰ6)e actions and har`†°dONLNd ?ñ6°M)Kdwarò`°dONLNd CñM°´)e actions into softwar◊@°dONLNd Yñ´°∂)^e r‡°dONLNd \ñ∂°‘) esults. ˝°dONLNd dñ‘°€)A7†°dONLNd eñ‹°fi) °dONLNd f¢ä≠(™äsynchronous device driver¿°dONLNd ¢≠ñ)y completes each communication rΩ`°dONLNd û¢ñ≠Ã)ì equest beforœ‡°dONLNd ™¢Ã≠◊)6e rfiİdONLNd ≠¢◊≠ˇ)     eturning °dONLNd ∂Æäπ†(∂äcontr>İdONLNd ªưπÎ)ol to the system. <`°dONLNd ÕÆÎπ˚)JAn U°dONLNd –Æ˚πx)asynchronous device driver⁄¿°dONLNd ÍÆxπ)}" can initiate a data transfer and ˇ*@ˇ ˇˇˇˇ@
  3384. ˇ·ˇ‚7^
  3385. 4*\˜, Palatino
  3386. .+l"CHAPTER œ´)\1,     Helvetica
  3387.     (@lThe Device Manager4⁄*˙¯
  3388. (‡*1 )-c)4
  3389.     )9About the Device Manager
  3390. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3391. 1/91(¯l Second line.4^*¿¯
  3392. °dONLNd]lho(elrE°dONLNd]ph°) eturn contrZ†°dONLNd ]°hˇ)1ol to the system beforİdONLNd"]h,)_ e the entirH@°dONLNd-],hÂ),,e transfer is complete. This type of device °dONLNdYilt∞(qldriver usually rI`°dONLNdii±tÌ)Eelies on interr»@°dONLNdxiÌt
  3393. )<upts frÈ¿°dONLNdi
  3394. t6)
  3395. om its har1`°dONLNdâi7tN)-dwari °dONLNdçiNtÉ)
  3396. e device to r›Ä°dONLNdöiÉt¥)5 egain contr.İdONLNd•iµt€)2
  3397. ol of the °dONLNdØulÄu(}lprG °dONLNd±uvÄT)
  3398. 2ocessor and continue or complete the data transfer}`°dONLNd„uTÄV)fi.°dONLNdÂálís(èlA∫†°dONLNdÊásí)Y device driver does not have to be associated with a device. In general, a device driver °dONLNd?ìlûá(õlis a prlİdONLNdFìáû)ogram that conforms to a pr°dONLNdaìû)|edefiÿ°dONLNdfìûh)ned format and prä °dONLNdwìiûÁ)Qogramming interface. Many °dONLNdëül™(ßl(device drivers take advantage of this prW`°dONLNdπü™0)Øedefi °dONLNdæü1™«)"ned interface to perform tasks unr@°dONLNd‡ü«™Ô)ñ
  3399. elated to °dONLNdÍ´l∂+(≥l,actual physical devices. Desk accessories arć°dONLNd´+∂‚)ø*e an example of this kind of device driverİdONLNd@´‚∂‰)∑.°dONLNdBΩl»—(≈lSome device drivers ar\°dONLNdXΩ—»È)ee stor_İdONLNd^ΩÈ»Ü)"ed in the Macintosh ROM; others ar °dONLNdÄΩá»ü)ûe stor †°dONLNdÜΩü»’)
  3400. ed in driver ˇˇ
  3401. Æ.°dONLNdì…l‘p(—l(,
  3402. Courierˇ˛\°dONLNdî»p‘î)'DRVR'ˇˇ
  3403. ưdONLNdö…î‘û)$) r`°dONLNdù…û‘µ)
  3404. esour2n°dONLNd¢…µ‘Ò)
  3405. ces, which ar *°dONLNdØ…Ò‘Ë)<7e typically located in applications, system extension fiϰdONLNdÁ…Ë‘˙)˜les, .°dONLNdÏ’l‡ï(›l    and the fiW@°dONLNdˆ’ñ‡¥)*rmwar9‡°dONLNd˚’¥‡)e of expansion car¥ °dONLNd
  3406. ’‡)Ods. ÆÄ°dONLNd’‡)AÈ °dONLNd’‡) i °dONLNd’‡`)driver resource¿°dONLNd"’a‡Ó)E  contains information about the °dONLNdB·lÏá(Èldriver‡°dONLNdH·áÏÈ)R, including the driver name, and the code necessary for the driver to perform its °dONLNdöÌl¯S(ıl3functions. The Device Manager must load a driver fr.†°dONLNdÕÌT¯ì)Ëom its driver r~ °dONLNd‹Ì쯴)?esourΔ`°dONLNd·Ì´¯Ú)ce into memory °dONLNd˘lÉ(lbefor_†°dONLNdı˘É∂)Ee your application or any part of the system can communicate with it.°dONLNd; lÓ(lVThe Device Manager opens certain device drivers at system startup time. These drivers °dONLNdël"•* make up the `°dONLNdù¶"):standard device drivers≥†°dONLNd¥"ö)j, which include the Disk Driverë`°dONLNd”ö")ä, the Serial Drivers, °dONLNdÈ#l.õ(+lBand printer drivers. The Device Manager opens other drivers when rÅ`°dONLNd+#õ.ı(+õequested—typically .°dONLNd>/l:¡(7lby initialization (°dONLNdQ.¡:Â)U'INIT'°dONLNdW/Â:)$) rR`°dONLNdZ/:) esour$¿°dONLNd_/:Æ)%ces, applications, and other drivers.
  3407. ?*Z¯4@*Z¯
  3408. k*s¯4l*s¯ l*l˛
  3409. ˇ·ˇ‚7^
  3410. ˇˇ£‰.ˇÆ°dONLNdÖX*jˆ(f*About the Device Managerˇˇˇˇˇˇ⁄|(fÓ1
  3411. °dONLNdû|lá‘(ÑlThe Device Manager prd@°dONLNd≥|‘á)h
  3412. ovides thr„İdONLNdΩ|áJ),ee basic services:,
  3413.  
  3414. Zapf Dingbats
  3415. °dONLNd–êlóq(ñln
  3416. °dONLNd“éxôã) It prh°dONLNd◊éãôÂ)ovides a common pr™@°dONLNdÈéÂôÒ)Z;ogramming interface for applications and other managers to °dONLNd$öx•D(¢x+use when communicating with device drivers.
  3417. °dONLNdPÆlµq(¥ln
  3418. °dONLNdR¨x∑–) It maintains data str#‡°dONLNdg¨—∑Ë)Yuctur©¿°dONLNdl¨Ë∑~)!es to manage open device drivers.
  3419. °dONLNdé¿l«q(Δln
  3420. °dONLNdêæx…ã) It prh°dONLNdïæã…‘)ovides support rF`°dONLNd•æ‘…¬)I4outines useful when writing your own device drivers.°dONLNd⁄–l€r(ÿlT∫¿°dONLNd€–q€î)ypicallyË¿°dONLNd„–ì€K)"(, your application won’t communicate dirŸÄ°dONLNd –K€Í)∏'ectly with device drivers; instead, it °dONLNd2‹lÁ‡(‰lwill call Device Manager rwİdONLNdL‹‡Á4)toutines or call the rB`°dONLNda‹5ÁÎ)U*outines of another manager that calls the °dONLNdãËlÛ¥(lDevice Manager$°dONLNdôË¥ÛÔ)HF. For example, your application can communicate with a disk driver by °dONLNdflÙlˇÙ(¸lcalling the Device Manager dirë¿°dONLNd˝ÙÙˇè)à$ectly or by calling the File Manageri¿°dONLNd!Ùèˇÿ)õ, which calls the °dONLNd3l ¥(lDevice Manager$°dONLNdA¥ ∂)H.°dONLNdClÑ(lFigurR¿°dONLNdHÑò)e 1-1@°dONLNdMòÕ)  shows the r*İdONLNdYŒΩ)64elationship between applications, the Device ManagerãİdONLNdçº⁄)Ó, other °dONLNdïl)(&l&managers, device drivers, and devices.ˇ©@ˇ ˇˇˇˇ@
  3421. ˇ·ˇ‚7^
  3422. 4H\, Palatino
  3423. .+ä"CHAPTER œ´)\1,     Helvetica
  3424.     (@äThe Device Manager4⁄ä˙(‡äAbout the Device Manager
  3425. 
  3426. ‡(‡1ù)-‡)5
  3427. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3428. 1/91(¯ä Second line.4^H¿
  3429. gHw4gHw"gH_
  3430. ˇ·ˇ‚7^
  3431.     °dONLNdˇˇ(dä
  3432. Figure 1-1°dONLNd\Ãg?)BCommunication with Devices
  3433. °dONLNdjäu°(räBeforÛ¿°dONLNd j°u)Me the Device Manager allows an application or another manager to communicate °dONLNdmväÅ‚(~äwith a device driverú‡°dONLNdÅv‚Å:)X, the driver must be @°dONLNdñv;ÅQ)YopenE‡°dONLNdövRÅ)%, which means the Device Manager has °dONLNdøÇäçç(äärE°dONLNd¿ÇéçΩ) eceived a rÅİdONLNdÀÇΩç+)/equest to open the driverx °dONLNd‰Ç+ç)n0, has loaded the driver into memory if necessaryg¿°dONLNdǡç)‘, °dONLNdéäô.(ñä&and has successfully called the driver9°dONLNd<é0ôd)¶ ’s opening r]¿°dONLNdHédôÇ)4outine.°dONLNdP†ä´(®äWhen opening a device driver놰dONLNdl†´w)Ö, the Device Manager cr†°dONLNdɆx´ò)ieates a @°dONLNdã†ò´Ú) device control entryü@°dONLNdü†Ú´)Z (DCE), °dONLNdߨä∑m(¥ä2which contains information about the device driverο°dONLNdŸ¨l∑Û)‚. For example, the device contr' °dONLNd¯¨Ù∑˛)àol °dONLNd˚∏ä√¯(¿äVentry contains a handle to the device driver code (or a pointer for device drivers in °dONLNdQƒäœ∞* ROM). T
  3434. ¿°dONLNdXƒ∞œ”)&ypically;¿°dONLNd`ƒ“œ©)"/, the Device Manager maintains one device contr>@°dONLNd胩œ )◊ol entry for each open °dONLNd¶–䀃(ÿä
  3435. device driverI¿°dONLNd≥–ƒ€y):., but it is possible for multiple entries to r‡°dONLNd·–z€›)∂efer to the same driver˛`°dONLNd¯–‹€fi)b.°dONLNd˙‚äÌ\(Íä-The Device Manager maintains another data str∑°dONLNd'‚\Ìs)“uctur<‡°dONLNd,‚tÌé)e, the c‡°dONLNd3‚é̺) unit table,†°dONLNd>‚ΩÌ‘)/ to or˘°dONLNdD‚”Ì) ganize the °dONLNdOÓä˘¿(ˆä device contrl`°dONLNd[Ó¿˘Œ)6@ol entries. The unit table contains a handle to the device contr&†°dONLNdõÓœ˘(ˆœ
  3436. ol entry for °dONLNd®˙ä‘(äeach open driver9¿°dONLNd∏˙‘@)J. The location of a driver@°dONLNd“˙AÄ)m’s device contrÖ‡°dONLNd·˙Ä)?%ol entry in the unit table is called °dONLNdäµ(ä
  3437. the driverÙ°dONLNd∂ø),’s x@°dONLNd¿˘)
  3438. unit number4†°dONLNd˘˛)9. °dONLNd!ä#( äWhen you open a device driver‘İdONLNd>#x)ä, the Device Manager rÿ@°dONLNdTx#û)d    eturns a Ï`°dONLNd]û#
  3439. )&driver reference number¿°dONLNdt#)p °dONLNdu$ä/ƒ(,äfor the driverµ@°dONLNdÉ$ƒ/…):. ᆰdONLNdÖ$…/œ)YH °dONLNdÜ$œ/ )ou use the driver rŒ °dONLNdô$ /0)Qeferz@°dONLNdù$1/j) ence number °dONLNd®$j/Û)9!, instead of the driver name, to °dONLNd…0ä;i(8ä1identify the driver in subsequent communication rb¿°dONLNd˙0i;√)flequests. The driver r,†°dONLNd0ƒ;‘)[eferÿ¿°dONLNd0‘;) ence number °dONLNd<äGó(Däis rÍ`°dONLNd#<óG{)
  3440. 3elated to the unit number by the following formula:°dONLNdW`äk1(hä$The Device Manager also maintains a ~‡°dONLNd{`2kê)®driver request queuew`°dONLNdè`ëk )_ for each open device driver°dONLNd´` k){. °dONLNd≠läw-(tä&At the head of this queue is the I/O rÏ@°dONLNd”l-w^)£ equest currN °dONLNdfil_wú)2ently being pr@°dONLNdÏlùw˛)>ocessed by the device °dONLNdxäÉ•(Äädriver‡°dONLNdx•É¡). The r†°dONLNdx¡Éo)'est of the queue contains pending I/O r«†°dONLNd6xoÉù)Æ    equests—r|İdONLNd?xûÉÚ)/equests the Device °dONLNdRÑäè…(åä
  3441. Manager has rÂ`°dONLNd_Ñ…èä)?-eceived but not yet sent to the device driverK¿°dONLNdåÑäè˘)¡. This queue allows your °dONLNd•êäõÕ(òäapplication to r≥¿°dONLNdµêÕõ˛)CEequest a data transfer with a busy device and accomplish other tasks °dONLNd˙úäßÓ(§äwhile the device satisfiˇÄ°dONLNdúÓß)des prM@°dONLNdúß')evious r§ °dONLNdú'ßJ)#equests.
  3442. wäQ4wäQ
  3443. wäQè4vâwäò"@@wä∂èflfl˝@‰˝‡‰˛‰˛¯‰˛¸‰˛˛‰˛ˇ‰˛?ˇÄ²ˇ¿Â˛ˇˇ‡Â    ˇˇ    ˇˇ¯Â    ˇˇ¸Â    ˇˇ˛Â˛ˇÂ
  3444. ?˛ˇÄÊ
  3445. ˛ˇ¿Ê    ˝ˇ‡Ê
  3446. ˝ˇ‡Á ˛ˇ¿Á?˛ˇ˛ˇ¯Î˛ˇ?˛ˇ˛Î˛ˇ‡˝ˇÄÏ˛ˇ‡˝ˇ¿Ï˛ˇ‡?˝ˇ¿Ï˛ˇ‡˝ˇ¿Ï˛˛ˇ¿˛‡Ï˛ˇ«¿˛‡Ï˛?ˇÉ¿˛Ï˛ˇ¿˝Ï˛˛Ä˝Ï ˛¸˚Ï ˛¯˚Ï ˛˚Ï ˝‡˚Ï
  3447. ¸¿Ï
  3448. ¸ÄÄÏ˝¿ªïπÕ¿Ï˛    ‡¶VL” Ï˛    fV4” Ï˛    ¯{ï‹Õ Ï˛¸"˝Ï˛˛"˝Ï˛"˝Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚¸Ï ˛˚¯Ï ˛˚Ï ˛˚‡Ï ˛˚¿Ï ˛˙ÄÏ˛¯ˇÄÒò"@Ä@Ä∂äˆè˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛¯ˇ¿Ò˛?¯ˇ¿Ò ˛˚¿Ï ˛˚‡Ï ˛˚Ï ˛˚¯Ï ˛˚¸Ï ˛˚¸Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˚Ï ˛˛˚¸Ï ˛¸˚¯Ï ˛¯˚Ï ˛˚‡Ï ˛‡˚¿Ï
  3449. ˝¿˙ÄÏ    ÚˇÄÒ    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Òò"ĿĿˆä5è    Úˇ¿Ò¯ÄÈ˘¿È˘‡È˘È˘¯È˘¸È˘È˘È˘È˘È˘È˘È˘È˘È˘È˘È˘È˘È˘¸È˘¸È˘¯È˘È˘‡È˘¿Èfl    ÚˇÄÒ    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò˘¿È˘‡È˘È˘¯È˘¸È˘È˘È˘È˘È˘È˘È˘È˘È˘È˘È˘È˘Èò"¿¿5äuè˘¸È˘¸È˘¯È˘È˘‡È˘¿È    ÚˇÄÒ    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿Ò    Úˇ¿ÒflflflflflflflflflflflflflflflflflflflflflflflflflÜ 0?ÄÄ`˛     `˚B˝Ä "¯ ˙"("˝Ä B¸ ˛ ˙!%(" #áÂ∂@@fñZaç¯fÉ'Δgg˝!%HB <â$⁄@ÄìjM"íHìA%$ÇJ%(©˝!EWD $â$í8@ÅJI$"IA)$ÑR)A$˝!IêD@AIÄÅîíD$ëÅjIú*A¬˝!âêH@AD[Äâ$ï≤‘≠µ$°≤ŸE≤2…)˝!>80‡·é- ¿pƒö”cÿƒ¡#iÇÃ#0Œ˝˘Ë˘Ë˘Ëò"&&uäöèflflÄa¿˝1›ÿp@˛!Ä˝àà` ˛"Ä˝àà†&À¿Rõ°ßõ`)†*I)@T§“I)†) RQB@UDîII%@\RCÄôI$ÜrF"&@íb @ô[-§JB"&@> C1Å”≠2Œ2‚wt‡˜ϘϘÍflflflflflflflflflflflflflflflflÄ@¸pÌÄĸ Ì
  3450. ÄÄ Ì4—§”/f¿ZÓ    i( $⁄i$£@M(ÓIH DíI%"I@Ó"äp E$äIƒí@Ó!$í»"I%í€$í»ÓòÅ@HHP˝,ªÄ˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3451. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3452. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3453.  
  3454.  
  3455.  ˛êêê@wä∂è'ÅÅ˚ÅÅ˚‡ˇÅù·˛ˇÅû ‚ˇˇˇˇÅü„ˇˇ˛ˇˇÅ†‰ˇˇ¸ˇˇÅ°Âˇˇ˙ˇˇÅ¢Êˇˇ¯ˇˇÅ£ÁˇˇˆˇˇÅ§ËˇˇÙˇˇÅ•ÈˇˇÚˇˇÅ¶ÍˇˇˇˇÅßΡˇÓˇˇÅ®ÏˇˇÏˇˇÅ©Ìˇˇ˝ˇˇˇÅ™ÓˇˇÙ˚ˇˇˇˇˇÅ´ÔˇˇÙˇˇ˘ˇ˛ˇˇÅ¨ˇˇÛˇ¯ˇˇ˛ˇˇÅ≠ÒˇˇÛˇˇ˛ˇ˚ˇˇ˛ˇˇÅÆÒˇˇÙˇˇ˜ˇˇˇˇˇ˜ˇˇÅ∫ˇˇ˘ˇ˝ˇ˜˛ˇÅ∫Ôˇˇ˜ˇˇ˝ˇ¯¸ˇ˙ˇˇ‹‚ˇÅÿÓˇˇ˜˛ˇÛ˝ˇ˚ˇˇ·‹˛ˇÅ⁄Ìˇˇˆˇˇı˝ˇ˚ˇˇfi‹˛ˇÅ‹Ïˇˇˆ˛ˇ˜˝ˇ˚ˇˇ‹‹ˇˇÅ›Îˇˇı˝ˇ˙˝ˇ˙ˇˇ‹‹ˇÅ›ÍˇˇÛ¸ˇ¸ˇ˘ˇˇ‹„ˇ¸‹ˇÅ›ÈˇˇÚ¯ˇ˜˛ˇÂ˛ˇ˛‹ˇˇÅfiˡˇÙˇˇ˛¸ˇˆˇˇ„ˇ˝‹ˇÅfiÁˇˇˆˇˇ¸˝ˇıˇ„ˇ˝‹ˇˇÅflÊˇˇ¯ˇˇ˙˛ˇ÷ˇ¸‹ˇÅfl¡ˇ˙ˇˇ¯ˇ’ˇ¸‹ˇÅfl‰ˇˇ¸ˇˇ ˇ¸‹ˇÅfl„ˇˇ˛ˇˇ…ˇ¸‹ˇÅfl‚ˇˇˇˇ»ˇ¸‹ˇÅfl·˛ˇ«ˇ¸‹ˇÅfl“ˇˆˇˇ˜ˇˇÓˇ¸‹ˇÅfl”ˇˇ˜ˇıˇÌˇ¸‹ˇÅfl7·ˇˇıˇˇ˛ˇ˛ˇˇˇˇˇ˛ˇ˛ˇˇˇ˛ˇˆˇ¸‹ˇÅfl7‚˝ˇˆ˛ˇ!ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˜ˇ¸‹ˇÅfl>„ˇˇ‹‹ˇˇ¯ˇ˛
  3456. ˇˇˇˇˇˇˇˇ˛ˇˇˇˇˇˇˇˇˇ˜ˇ¸‹ˇÅfl=‰ˇˇ˝‹ˇˇ˘ˇ˛˝ˇ˛ˇˇˇ˛ˇ˛ˇ ˇˇˇˇˇˇ˜ˇ¸‹ˇÅfl¡ˇ˚‹ˇˇıˇ˛ˇ€ˇ¸‹ˇÅfl²ˇ˝‹˝ˇˆˇ˛ˇ€ˇ¸‹ˇÅfl„ˇ˝‹ˇÛˇ˛ˇ€ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ ˛ˇ¸‹˛ˇÅ·„ˇ˝‹ˇ…ˇˇ¸‹ˇˇÅ‡„ˇ˝‹ˇ»ˇˇ˛‹ˇˇÅfl„ˇ˝‹ˇ«ˇˇ‹ˇˇÅfi„ˇ˝‹ˇΔ˛ˇÅ›„ˇ˝‹ˇ≈ˇÅ‹„ˇ˝‹ˇÏ±ˇÑòÅ@ÄHHP˝(ºÄ˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3457. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3458. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3459.  
  3460.  
  3461.  ˛êêê@Ä∂äˆè'„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ%„ˇ˝‹ˇÏˇıˇˇ˛ˇˇÙˇ˛ˇÿˇˇÖ&„ˇ˝‹ˇÏˇˆˇˇˇˇÙˇˇˇˇÿˇˇÖI„ˇ˝‹ˇÏˇ˜ˇ˝˚ˇ˛ˇˇˇˇ˛ˇˇˇˇ˛ˇ˛ˇ˛ˇ˛ˇ
  3462. ˇˇˇˇˇˇˆˇˇÖD„ˇ˝‹ˇÏˇ˜ˇ˝ˇˇˇˇ¸ˇ˝ˇˇˇˇ˝˛ˇˇ˛˛ˇˇ¸ˇ˝ˇ˜ˇˇÖN„ˇ˝‹ˇÏˇˆ ˇˇˇˇˇˇ˛ˇ˝ˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇˇ˜ˇˇÖF„ˇ˝‹ˇÏˇıˇˇ˛ˇˇˇ˝ˇ˝ˇˇˇ˛˝ˇˇ˛ˇ˛ˇ˝ˇ˛ˇˇˆˇˇÖ„ˇ˝‹ˇÏˇ ˇÎˇˇÖ„ˇ˝‹ˇÏˇÕ˛ˇÍˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏˇ≥ˇˇÖ„ˇ˝‹ˇÏ∞ˇÖ„ˇ˝‹ˇÎ±ˇÖ„ˇ˝‹ˇΔ˛ˇÅ›„ˇ˝‹ˇ«ˇˇ‹ˇˇÅfi„ˇ˝‹ˇ»ˇˇ˛‹ˇˇÅfl„ˇ˝‹ˇ…ˇˇ¸‹ˇˇÅ‡„ˇ˝‹ˇ ˇˇ˙‹ˇˇÅ·„ˇ˝‹ˇ ˛ˇ¸‹˛ˇÅ·„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl„ˇ˝‹ˇ»ˇ¸‹ˇÅfl²ˇ˝‹˝ˇÕ˛ˇ¸‹˛ˇÅ·Âˇˇ˚‹ˇˇÀˇˇ¸‹ˇˇÅ‡‰ˇˇ˝‹ˇˇ…ˇˇ˛‹ˇˇÅfl„ˇˇ‹‹ˇˇ«ˇˇ‹ˇˇÅfi ‚˝ˇ≈˛ˇÅ›
  3463. ·ˇˇ√ˇÅ‹ÛÜˇÑ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖÛˇ‚˛ˇˆˇ¯ˇ˛ˇƒˇˇÖÛˇ‚ˇˇÌˇˇˇˇƒˇˇÖCÛˇ‚ ˇˇˇˇˇ˛ˇˇˇˇˇˇˇˇˇ˛ˇ˛ˇ˛ˇ˛˛ˇˇˇˇˇfiˇˇÖ=Ûˇ‚ˇˇ˝ˇˇˇˇˇ¸ˇˇˇˇˇ˝˛ˇ
  3464. ˇˇˇˇ¸ˇˇ›ˇˇÖAÛˇ‚ˇˇˇ˝ˇˇˇˇ˛ˇ˝
  3465. ˇˇˇˇˇˇˇ˛ˇˇˇˇˇ˝ˇ›ˇˇÖ?Ûˇ‚˛ˇ˛˛ˇˇˇ˛ˇ˛ˇˇˇˇ˛˝ˇˇ˛ˇ˛ˇ˛ˇˇ›ˇˇÖÛˇ≥ˇ◊ˇˇÖÛˇ∂˛ˇ÷ˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖÛÖˇÖòÅÄ¿HHP˝,ΩIJˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3466. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3467. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3468.  
  3469.  
  3470.  ˛êêêÄ¿ˆä5è'ÚܡÖπˇÅƒ∫˛ˇÅ≈ ªˇˇ‹ˇˇÅΔºˇˇ˛‹ˇˇÅ«Ωˇˇ¸‹ˇˇÅ» æ˛ˇ¸‹˛ˇÅ… ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« æ˛ˇ¸‹˛ˇÅ…æˇˇ˙‹ˇˇÅ…Ωˇˇ¸‹ˇˇÅ»ºˇˇ˛‹ˇˇÅ« ªˇˇ‹ˇˇÅΔ∫˛ˇÅ≈ÅÅ˚ÛÜˇÑ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖÛˇfl˛ˇ˜ˇı˛ˇ¸ˇÕˇˇÖÛˇflˇˇÎˇˇ»ˇˇÖ>Ûˇfl
  3471. ˇˇˇˇˇ˛ˇˇˇˇˇ˝ˇˇˇˇˇˇˇˇˇˇˇˇˇˇ€ˇˇÖ8Ûˇflˇ¸ˇ    ˇˇˇˇ¸ˇ˛ ˇˇˇˇˇˇ˝ˇˇ˝ˇ‹ˇˇÖ;Ûˇflˇˇˇ˝ˇˇˇˇ˛ˇ˚
  3472. ˇˇˇˇˇˇˇ˝ˇˇˇˇ‹ˇˇÖ;Ûˇfl˛ˇ˛ˇˇˇ˛ˇ˛ˇ˛˛ˇˇˇˇ˛˛ˇˇˇˇ€ˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖÛÖˇÖÚܡÖ∫˛ˇÅ≈ ªˇˇ‹ˇˇÅΔºˇˇ˛‹ˇˇÅ«Ωˇˇ¸‹ˇˇÅ» æ˛ˇ¸‹˛ˇÅ… ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ« ºˇ¸‹ˇÅ«òÅ¿HHP˝(æÄ˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3473. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3474. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3475.  
  3476.  
  3477.  ˛êêê¿5äuè' æ˛ˇ¸‹˛ˇÅ…æˇˇ˙‹ˇˇÅ…Ωˇˇ¸‹ˇˇÅ»ºˇˇ˛‹ˇˇÅ« ªˇˇ‹ˇˇÅΔ∫˛ˇÅ≈ÛÜˇÑ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖÛˇ‘˛ˇ˜ˇ√ˇˇÖÛˇ‘ˇˇπˇˇÖ)Ûˇ‘
  3478. ˇˇˇˇˇ˛ˇˇˇˇˇ˛ˇˇ–ˇˇÖ$Ûˇ‘ˇˇ¸ˇˇˇˇ¸ˇ˝ˇ—ˇˇÖ)Ûˇ‘ˇˇˇ˛ˇˇˇˇ˛ˇ˝ˇˇˇ—ˇˇÖ&Ûˇ‘˛ˇ˛˛ˇˇˇ˛ˇ˛ˇˇˇ–ˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖ ÛˇàˇˇÖÛÖˇÖÚܡÖÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚H̸ˇ˝ˇˇ˝˛ˇ˚ˇˇ˝ˇˇ˚˙ˇ„ˇˇ˘ˇˇ˘˛ˇˇÁˇˇÁˇ¸ˇˇ˜ˇˇıˇ€>Ïˇ˛ˇ˝ˇ˝˛ˇ˚˛ˇ˝˛˙˛˛˛·ˇ¯ˇ˙ˇ˛ˇ≤ˇˆˇŒBÏˇ˝ˇ˛ˇ˛ˇˇ¸ˇ˛ˇ˝ˇ˙ˇ›ˇ¯ˇ˚ˇ˝ˇ÷ˇ·ˇˇıˇŒ©Ìˇ¸
  3479. ˇˇˇˇˇ¸ˇ˛ˇ˛ˇ˙ˇ˛˛ˇ˝˚ˇ ˇˇˇˇˇˇˇ˘ˇ¯ˇ˙ˇ˙ˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˝ˇˇ˛ˇˇ˚ˇ˝ˇˇˇˇˇ¸ˇˇˇ˛ˇ˙ˇ˙˛ˇ˛ˇˇˇˇ˛ˇ˛ˇˇ˝ˇˇ˛ˇÎ¬Ìˇ¸
  3480. ˇ˛ˇ˛ˇ˝˛˝ˇ˛ˇ˙˛ˇ˛ˇ˛ˇˇˇ˛ˇ˛ˇˇˇ˘ˇ¯˛˚ˇ˙ˇˇˇˇ˛ˇˇˇ˛ˇ˛ˇˇ˛ˇˇˇˇ˛ˇ˛    ˇˇˇˇ˛¸ˇˇ˛ˇˇ˛ˇ¸ˇ˛ˇˇ˛
  3481. ˇ˛ˇˇˇ˛ˇˇˇˇÎΔÌˇ˝ˇ˛ˇˇˇˇ˛ˇˇ˛ˇ˝ˇ˙ˇˇˇ˛ˇˇˇˇˇˇˇ˘ˇ˛ˇ˝ˇ˚ˇ˚ˇ˛ˇˇˇˇˇˇˇˇˇˇ˝ˇ˛    ˇˇˇˇ˛ˇˇˇ¸ˇˇˇˇˇˇˇ˝ˇ˛ˇˇˇ˛ˇˇˇˇ¸ˇˇˇÈ¥Óˇ¸
  3482. ˇˇˇˇˇ¸ˇ˛ˇ˛ˇ˙ˇ¸ˇ¸
  3483. ˇˇˇˇˇ˛˛ˇ˘ˇ¯ˇ˙ˇ˚ˇ˛ˇˇˇˇˇˇˇˇˇ˛ˇ˝    ˇˇˇˇ˛ˇ˛ˇˇˇ˚ˇˇˇˇˇˇˇˇ¸ˇˇ˛ˇ˝ˇˇˇˇ¸˛ˇ˝ˇÍ Ó˛˛˛ˇ˛ˇ˛ˇ˛¸ˇˇ˝ˇ˙ˇ¸˛ˇ˛ˇ˛ˇ˛ˇˇ˛˛˛ˇ˙ˇ¯ˇ˙ˇ˛>ˇ˛ˇˇˇ˛ˇ˛ˇˇ˛ˇˇˇ˛ˇˇˇˇˇ˛ˇˇ˛ˇ˛ˇˇˇˇ˝˛ˇˇ˛ˇˇˇ˛ˇ˛ˇ˛    ˇ˛ˇˇ˛ˇ˛ˇ˛ˇˇˇˇ˛ˇˇ˛Î¥Ô¸ˇ˝˛ˇˇ˛ˇ¸ˇˇ˝˛ˇ¸˛ˇ˝ˇˇ˛˛ˇ˛ˇˇˇˇ˝ˇˇ˙˛ˇ˙˛ˇ˙˛ˇ˝ˇˇ˛ˇˇˇˇˇˇˇˇˇˇˇˇ˛ˇˇ˛    ˇˇˇˇˇˇˇ˛ˇˇ˛ˇˇˇ¸ˇˇ˛
  3484. ˇˇˇˇˇˇˇ¸ˇˇˇˇˇ˝ˇ˛ˇˇˇˇ˝ˇˇ˛ˇÍ æˇ˛ˇÅ√ æˇ˛ˇÅ√Ω˛ˇÅ¬òÅ&HHP˝,øÄ˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3485. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3486. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3487.  
  3488.  
  3489.  ˛êêê&uäöè'ÅÅ˚ÅÅ˚.̸ˇÛˇˇˇ˝˛ˇŸˇˇ˛˛ˇ˛ˇ˛ˇˇˇ˝˛ˇÅˇ.Ïˇ˛ˇ·ˇ˝ˇˇ◊ˇ˝ˇ˛ˇ˛ˇ˛ˇ˝ˇˇÅ˛0Ï˛˝ˇ‚ˇ˛ˇˇ◊ˇ˝ˇ˛ˇ˛ˇ˛ˇ˛ˇˇÅ˛jÌˇ¸
  3490. ˇˇˇˇˇˇˇˇ˛ˇˇ˛ˇˇ˙ ˇˇˇˇˇˇ˛ˇˇ˝ˇˇˇ˝ˇ    ˇˇˇˇˇˇ˙ˇˇˇ˛ˇ˛ˇ˛ˇˇˇˇÅ˛lÌˇ¸ˇˇˇˇˇˇˇˇˇˇ˙)ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˙ˇˇˇ˛ˇ˛ˇ˛ˇˇˇˇÅ˛hÌˇ˝
  3491. ˇ˛ˇˇ˛˛˛ˇ˝ˇˇ˙ˇ˛ˇ˛ˇ˛ˇˇ˛ˇ˛ˇˇ˛ˇˇ˛˜ˇˇ˛˛˛˛˛˛˛ˇ˛ˇÅ˝dÓˇ¸ˇ˛ˇ˛ˇˇˇˇ˝˛ˇ˙ˇˇˇˇˇˇˇˇˇˇ˝ˇˇ˛ˇˇ˜ˇ˛ˇˇ˛ˇ˛ˇ˛ˇˇˇˇÅ˝kÓˇ˛ ˇˇˇˇˇˇ˛ ˇˇˇˇˇˇ˚ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇ˜ˇ˝ˇ˛ˇ˛ˇ˛ˇˇˇˇÅ˝oÔ˛ˇ˛ˇ¸ˇ˛˛˛˝ˇˇˇˇ˛ˇˇ˚ˇˇ˛ˇ˛ˇˇˇ˛ˇˇˇˇˇ˛ˇ˛ˇ˛ˇˇˇ¸ˇ˛ˇ˛ˇ˛ˇ˛ˇˇ˛ˇˇ˛ˇˇ˛ˇ˛ˇÅ˛Æˇ˛ˇıˇÅ‡Æˇ˛ˇˆˇÅfl≠˛ˇÅ“ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚͡Úˇˇı˛ˇˇ“˛ˇÅÁΡ˛Òˇˆˇ˛ˇ–ˇÅÊΡˇÒˇ˜ˇ˝ˇ‰ˇÓˇÅÊZÏˇˇˇˇˇˇˇˇ˛ˇ˛ˇˇ˚ˇ˙ˇˇˇˇˇˇˇˇˇˇˇˇ˝ˇ    ˇˇˇˇˇˇ˙ˇˇˇˇ˝ˇˇÅ^Ìˇˇ˛ˇˇˇ˛ˇˇˇˇˇ¸ˇ˙ ˇ˛ˇ˛ˇˇˇ˛ˇˇˇˇ˛ˇˇ˛ˇˇ˛˙ ˛ˇ˛ˇˇˇÅVÓ¸ˇ˛ˇˇˇˇˇˇˇ¸ˇ˚ˇ˛ˇˇˇˇˇˇˇˇˇˇˇ˛ˇ˜ˇˇˇˇÅÌWÓˇ˛ˇˇ˛ˇˇ˛ˇˇ˛ˇ˚ˇ˚ˇ˛ ˇˇˇˇˇ˛
  3492. ˇˇˇˇ˛ˇ˛ˇ˜    ˇˇˇˇÅÌ`Ôˇ˝˛ˇˇˇ˛ˇˇˇˇ¸ˇ˛'ˇˇˇ˛ˇˇ˛ˇ˛ˇˇˇ˛ˇˇ˛ˇˇ˜ ˇ˛ˇˇˇˇÅò"@@öä⁄ès∏„01&·lƒ!”0ÄÔ˛A˝˛ Ï˛A˝˛@Ï ˛„IJÄÈflfl    Ä;ÄÂ@‰@‰ Ä$ÀGÄÁ
  3493. 8I•Ê
  3494. (I"Ê
  3495. DíDÊ
  3496. B∂YÊ
  3497. 8ÁZoÊflflflflfl ò¸0Í à¸H$Í
  3498. à ÄDÍ
  3499.     N˚7Ÿ∞DÍ
  3500.     RMI$–`ÑÍ
  3501.     HHâDÄàÍ
  3502. $ÑêíEàÍ
  3503. ≠≤∞∂… êÍ
  3504. ;2‹–[1¬`Íflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflò"@Ä@Ä⁄äèflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflò"ĿĿäYèflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflò"¿¿Yäòèflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflò"&&òäæèflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflflòÅ@HHP˝(¿Ä˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3505. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3506. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3507.  
  3508.  
  3509.  ˛êêê@öä⁄è'^˛ˇ˛ˇ˛ˇ˛˛ˇ˛ˇˇˇˇ˙˛ˇ˝ˇˇ˛ˇˇˇˇ˛ˇ˝
  3510. ˇˇˇˇˇˇˇ˛ˇ˝ˇ˝˛ˇ    ˇˇˇˇˇ˝ˇÅÙˡ¸ˇ⁄ˇÁˇÅfi˲¸ˇ⁄ˇË˛Å›È˛ˇ˛˛ˇ‹˛ˇÅƒÅÅ˚ÅÅ˚̸ˇ¯˛ˇ˛ˇÅ§Ïˇ˛ˇ¯ˇ˛ˇÅ£Ï˛˛˛¯ˇˇÅ¢#Ìˇ˛ˇ¯ˇˇˇˇˇˇˇˇ˛˝ˇÅ¥Ì˝ˇ˜˛ˇ˝ˇˇˇˇˇˇˇÅ≥ÌˇÙˇˇ˝    ˇˇ˛ˇ˛ˇÅ≤ ÓˇÙˇ˛ ˇˇˇˇˇ˛ˇÅ±!ÓˇÙˇ˝ˇˇˇˇˇˇˇˇˇˇÅ≥'Ô˛ˇ˚ˇ˝ˇ˛ˇ˛ˇˇ˛ˇˇˇ˛ˇˇ˛ˇˇÅ≥ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚Ìˇ˛˛ˇˇˇ‘ˇˇ˙ˇˇÅ–Ïˇˇ˛ˇ’ˇˇ¸ˇˇÅ—#Ïˇˇ˛ˇÙˇÙˇÓˇ˝ˇ˛ˇÅ—CÌˇ˛˛˛ˇˇˇ˛ˇ˛ˇ˛ˇˇ˛ˇ˛ˇˇ˛ˇˇ˛ˇ˛ˇˇ˛˙˛¸ˇ˛ˇÅ—DÌˇˇ˛(ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ¸ˇˇ¸ˇ˝ˇÅ—?Ìˇˇ˛    ˇˇˇˇ˝ˇˇ˛ˇ˛ˇˇˇ˛ˇˇ˜ˇ˝ˇ˛ˇÅ–>Óˇˇ˛ˇ˛ˇ˝˛ˇˇ˝    ˇˇˇ˛˛˛ˇˆˇ˝ˇ˛ˇÅ–AÓˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˝ˇˇˇˇˇˇˇˇˇ˙ˇˇ¸ˇˇÅœ?Ô˛ˇ
  3511. ˇˇˇˇˇˇˇ˛ˇˇˇˇ¸
  3512. ˇˇˇˇˇˇˇ˛ˇ˘ˇˇ˝ˇˇˇÅŒÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚òÅ@ÄHHP˝,¡Ä˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3513. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3514. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3515.  
  3516.  
  3517.  ˛êêê@Ä⁄äè'ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚òÅÄ¿HHP˝(¬Ä˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3518. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3519. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3520.  
  3521.  
  3522.  ˛êêêÄ¿äYè'ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚òÅ¿HHP˝,√IJˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3523. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3524. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3525.  
  3526.  
  3527.  ˛êêê¿Yäòè'ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚òÅ&HHP˝(ƒÄ˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  3528. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  3529. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  3530.  
  3531.  
  3532.  ˛êêê&òäæè'ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚ÅÅ˚
  3533. LäZ},TimesÖ°dONLNdˇˇ(VîUåw°dONLNdˇˇ)n˛°dONLNdˇˇ)ib≈°dONLNdˇˇ)t±å°dONLNdˇˇ)N‰ì°dONLNdˇˇ)ul°dONLNdˇˇ)m+¡°dONLNdˇˇ)b≥H°dONLNdˇˇ)e´°dONLNdˇˇ)r
  3534.     »L°dONLNdˇˇ)1,    Symbol/°dONLNdˇˇ(VŸ-
  3535. °dONLNdˇˇ)D€µ°dONLNdˇˇ)rF‹°dONLNdˇˇ)idONLNdˇˇ)vçj°dONLNdˇˇ)eÖ1°dONLNdˇˇ)rX°dONLNdˇˇ)Rìü°dONLNdˇˇ)eãf°dONLNdˇˇ)f⁄-°dONLNdˇˇ)e—Ù°dONLNdˇˇ)r=°dONLNdˇˇ)e4‚°dONLNdˇˇ)nºi°dONLNdˇˇ)c¥0°dONLNdˇˇ)e´˜°dONLNdˇˇ)Nfi˛°dONLNdˇˇ)ufÖ°dONLNdˇˇ)m&,°dONLNdˇˇ)b≠≥°dONLNdˇˇ)e•z°dONLNdˇˇ)r
  3536.     ˘ö°dONLNdˇˇ)
  3537. 1…°dONLNdˇˇ(Va+8ðdONLNdˇˇ(VÓ(fi,°dONLNdˇˇ))àL°dONLNdˇˇ(VÂ¥ذdONLNdˇˇ(V–=ˇ#Ï@ˇ ˇˇˇˇ@
  3538. ˇ·ˇ‚7^
  3539. 4*\˜, Palatino
  3540. .+l"CHAPTER œ´)\1,     Helvetica
  3541.     (@lThe Device Manager4⁄*˙¯
  3542. (‡*1 )-c)6
  3543.     )9About the Device Manager
  3544. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3545. 1/91(¯l Second line.4^*¿¯
  3546. °dONLNd]lhv(elWÛ`°dONLNd]uhá)    ith r4İdONLNd]àh„)espect to the driver rm°dONLNd]„h„)[7equest queue, the Device Manager allows you make to thrº†°dONLNdS]„hÔ(e„ee °dONLNdViltï(ql
  3547. types of rˆ°dONLNd`iïtÿ))equests: synchr|†°dONLNdoiŸt)Donous, asynchr!@°dONLNd}itÅ)Conous, and immediate.°dONLNdì{lÜö(Él
  3548. The terms K`°dONLNdù{õÜ∂)/synchrܰdONLNd£{∂ÜÕ)onoush`°dONLNd®{ŒÜ„) and UİdONLNd≠{‰Ü)asynchr`°dONLNd¥{Ü) onous‚¿°dONLNdπ{ÜA)     have difN`°dONLNd¬{BÜN)'fer0‡°dONLNd≈{NÜ„)  ent meanings depending on their °dONLNdÂálíë(èl    context. °dONLNdÔôl§å*When r1`°dONLNdıô秡)!eferring to a device driverH@°dONLNdôˇ§+)r , the term ¯@°dONLNdô+§F),synchr2‡°dONLNd!ôG§^)onous@°dONLNd&ô_§Õ) indicates that the driver °dONLNdA•l∞¿(≠lcompletes the entirü°dONLNdT•¿∞À)Te r≠†°dONLNdW•À∞) equest befor¿ °dONLNdc•∞ )6e rŒ¿°dONLNdf• ∞K) eturning contr-@°dONLNdt•L∞∫)@ol to the Device ManagerD`°dONLNdå•∫∞È)n . The term °dONLNdó±lºã(πlasynchr*‡°dONLNdû±åº£) onous
  3549. @°dONLNd£±§ºI)' indicates that the driver can begin pr4°dONLNd ±Iº|)• ocessing a rk@°dONLNd÷±|º≤)3 equest and r–@°dONLNd‚±≤º„)6 eturn contr‡°dONLNḏ„ºÌ)1ol °dONLNdΩl»È(≈lto the Device Manager befor÷@°dONLNd ΩÈ»)}e the rB@°dONLNdΩ»Ÿ)0equest is complete. When a driver is handling a °dONLNdB…l‘o(—lrE°dONLNdC…p‘≤)equest asynchr°dONLNdQ…≤‘’)Bonouslyx@°dONLNdX…‘‘)", it usually r °dONLNdf…    ‘E)5elies on interrí°dONLNdu…E‘b)<upts fr≥İdONLNd|…b‘ë)
  3550. om the harp¿°dONLNdÜ…í‘©)0dwar®Ä°dONLNdä…©‘⁄) e device to °dONLNdñ’l‡û(›l continue prK °dONLNd°’ü‡€)3ocessing the r_¿°dONLNdØ’€‡˙)<equest.°dONLNd∑ÁlÚå(ÔlWhen r1`°dONLNdΩÁçÚ¡)!
  3551. eferring to r√İdONLNd Á¡Ú)4equests, the terms †`°dONLNd›ÁÚ.)Rsynchr€°dONLNd„Á.ÚE)onousΩ`°dONLNdËÁFÚ[) and ™Ä°dONLNdÌÁ\Ú{)asynchrU`°dONLNdÙÁ|Úì) onous7¿°dONLNd˘ÁîÚ‚) indicate how the °dONLNd Ûl˛¿(˚lDevice Manager pr(İdONLNdÛ¡˛¯)U
  3552. ocesses the r˙‡°dONLNd)Û˜˛)6equest. O`°dONLNd1Û˛>)"ActuallyİdONLNd9Û>˛œ)%", you can specify that the Device °dONLNd[ˇl
  3553. †(l
  3554. Manager prY °dONLNdeˇ†
  3555. Õ)4 ocess the r$‡°dONLNdpˇŒ
  3556. #).equest in one of thrD °dONLNdÑˇ#
  3557. H)Uee ways.,
  3558.  
  3559. Zapf Dingbats
  3560. °dONLNdçlq(ln
  3561. °dONLNdèxfl) Synchronous requests.À¿°dONLNd§flQ)g When you make a synchrî¿°dONLNdªRs)sonous r⁄@°dONLNd¬sÔ)!equest, the Device Manager °dONLNd›x(±(%x
  3562. places your r§¿°dONLNdͱ(;)9!equest at the end of the driver rs °dONLNd <(Ô)ã&equest queue. The Device Manager then °dONLNd1)x4/(1x*waits until the driver has handled every r˚‡°dONLNd[)/4«)∑#equest in the queue, including the °dONLNd~5x@ï(=xsynchr$ °dONLNdÑ5ñ@fl)onous one, beforî¿°dONLNdî5fl@Í)Ie r£`°dONLNdó5Í@)) eturning contr‡°dONLNd•5*@ø)@#ol to your application. Notice therò@°dONLNd»5ø@Û)ï e can never °dONLNd‘AxLó(Ixbe mor_¿°dONLNd⁄AóLÂ)e than one synchrC °dONLNdÎAÂL)Nonous rà†°dONLNdÚALX)!equest per driver rò °dONLNdAXLÊ)R equest queue at any given time. °dONLNd%MxX˘(Ux(The driver can handle each rÎ@°dONLNdBM˘Xo)Åequest in the queue synchr°dONLNd\MpXƒ)wonously or asynchrò@°dONLNdnMƒXÁ)TonouslyÙİdONLNduMÊXÎ)", °dONLNdwYxd(ax!but the Device Manager does not rˆ°dONLNdòYdA)ò eturn contr †°dONLNd£YBd—)2"ol to your application until the fi¨`°dONLNdΔY—d·)ènal °dONLNd exp{(mxrE°dONLNdÀe|p”)equest is complete.)
  3563. °dONLNd‡ylÄq(ln
  3564. °dONLNd‚wxÇÂ) Asynchronous requests.ÁİdONLNd¯wÂÇb)m When you make an asynchrҰdONLNdwcÇÑ)~onous r«`°dONLNdwÑÇ÷)!equest, the Device °dONLNd+Éxé€(ãxManager places your r∂¿°dONLNd@É€ée)c!equest at the end of the driver rÖ °dONLNdaÉfé√)ãequest queue, but it r≥İdONLNdwÉ√é·)]eturns °dONLNd~èxöé(óxcontr>İdONLNdÉèèö|)4ol to your application immediately—potentially befor*`°dONLNd∑è|öó)Ìe the rñ`°dONLNdæèóöŸ)equest is satisfi  °dONLNdœè⁄öÈ)Ced. °dONLNd”õx¶~(£xY@İdONLNd‘õ~¶’)our application is fr$‡°dONLNdÈõ’¶®)W1ee to perform other tasks while the driver satisfi˙@°dONLNdõ®¶«)”es the r£@°dONLNd#õ»¶ˆ)  equests in °dONLNd.ßx≤
  3565. (Øx its queue. The Device Manager pr܆°dONLNdNß
  3566. ≤Ã)ï*ovides mechanisms for your application to °dONLNdx≥xæ(ªx$determine when the driver has satisfiı@°dONLNdù≥æ=)§ed the r}°dONLNd•≥>æ_)"equest. 
  3567. °dONLNdÆ«lŒq(Õln
  3568. °dONLNd∞≈x–‘) Immediate requests.=‡°dONLNd√≈’–p)]! When you call a Device Manager r`°dONLNd‰≈p–Δ)õoutine immediately•†°dONLNdˆ≈≈–⁄)U, the °dONLNd¸—x‹˙(ŸxDevice Manager sends your rUİdONLNd—˙‹&)Ç
  3569. equest dirQİdONLNd!—&‹t),ectly to the driverˆ`°dONLNd4—s‹’)M, bypassing the driver °dONLNdK›xË{(ÂxrE°dONLNdL›|Ë“)equest queue, and r‰†°dONLNd_›“Ë)V eturns contr7@°dONLNdk›Ëô)6!ol to your application when the rh°dONLNdå›ôËÔ)ëequest is complete. °dONLNd†ÈxÙ™(Òx
  3570. An asynchr<¿°dONLNd™È´Ù)3onous device driverá°dONLNdΩÈÙ@)W, which can pr‚ °dONLNdÀÈ@Ù…)>ocess a single communication r8‡°dONLNdÈÈ ÙÙ)ä
  3571. equest in °dONLNdÛıxH(˝x/a number of steps, might be in the middle of prø‡°dONLNd    "ıHò)–ocessing another r°dONLNd    4ıô∫)Qequest. bİdONLNd    <ı∫¡)!Aù °dONLNd    =ı¡‰)     similar °dONLNd    Fx (    x%situation can exist even for a synchrg °dONLNd    k È)û.onous device driver if you make the immediate °dONLNd    ô
  3572. x{(xrE°dONLNd    ö
  3573. |‘)equest during interrÌ@°dONLNd    Æ
  3574. ‘’)X<upt time. Device drivers that can handle this situation corr¶ °dONLNd    Í
  3575. ÷Ì(÷ectly °dONLNd    x$Ä(!xarE°dONLNd    ÚÅ$§)        e called 5°dONLNd    ˚•$Œ)$    reentrant€Ä°dONLNd
  3576. Œ$ı))
  3577.  drivers. ì`°dONLNd
  3578. ı$g)'As some device drivers ar‡°dONLNd
  3579. 'g$É)re not r¿°dONLNd
  3580. .Ñ$‚)eentrant, you should °dONLNd
  3581. C%x0◊(-xalways check a driver,¿°dONLNd
  3582. X%Ÿ0?)a’s documentation befor<@°dONLNd
  3583. n%?0†)fe making immediate ra°dONLNd
  3584. Ç%†0√)aequests.°dONLNd
  3585. ã7lB3(?l+The next section, “Using the Device Manager¯¿°dONLNd
  3586. ∂72BÍ)Δ*,” describes how to specify the manner in °dONLNd
  3587. ‡ClN(Kl"which the Device Manager should prg`°dONLNd CNE)§ ocess your rT °dONLNd CENd)5equest.°dONLNd Ul`±(]lThe chapter “W¿¿°dONLNd $U±`À)Eriting y`°dONLNd +UÃ`“)Y9‡°dONLNd ,U“`§)-our Own Device Driver” in this book gives mor°dONLNd YU§`‚)“e information °dONLNd gall(il!about the Device Manager data str¡Ä°dONLNd àal)òucturG`°dONLNd çal’))es and also describes the Device Manager °dONLNd ∂mlxo(ulrE°dONLNd ∑mpx$)*outines useful for writing device drivers.ˇ ú@ˇ ˇˇˇˇ@
  3588. ˇ·ˇ‚7^
  3589. 4H\, Palatino
  3590. .+ä"CHAPTER œ´)\1,     Helvetica
  3591.     (@äThe Device Manager4⁄ä˙(‡äUsing the Device Manager
  3592. 
  3593. ‡(‡1ù)-‡)7
  3594. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3595. 1/91(¯ä Second line.4^H¿
  3596. ^Hx4^Hx
  3597. äHë4äHë äHä
  3598. ˇ·ˇ‚7^
  3599. ˇˇ£‰ˇÆ°dONLNdvHà(ÑHUsing the Device Managerˇˇˇˇˇˇ⁄|(Ñ 1
  3600. °dONLNdöä•ê(¢äY@İdONLNdöê•H)(our application can use Device Manager r\`°dONLNdBöH• )∏,outines to communicate with devices. It can °dONLNdn¶ä±∏(Æä use these r6¿°dONLNdy¶π±)/Moutines to open and close device drivers, to exchange information with them, °dONLNdΔ≤äΩÌ(∫äand to otherwise contrÔ°dONLNd‹≤ÌΩJ)col and monitor them.°dONLNdÒƒäœÂ(ÃäNThe Device Manager includes high-level and low-level versions of most of its re†°dONLNd?ƒœ
  3601. (à   outines. °dONLNdH–䀸(ÿäThe high-level versions ar‡°dONLNdb–˝€€)s3e somewhat easier to use, but they allow less contrø†°dONLNdï–€€)fi
  3602. ol of how °dONLNdü‹äÁ!(‰ä!the Device Manager executes the r›`°dONLNd¿‹!Áÿ)ó)outine (for example, they always execute °dONLNdÈËäÛß(äsynchr$ °dONLNdÔË®Û˛)onously) and they r醰dONLNd˲ÛÌ)V6eturn less information to your application. Conversely]°dONLNd8ËÌÛ)Ô, the °dONLNd>Ùäˇπ(¸ä low-level rÿ°dONLNdIÙπˇfl)/    outines rú`°dONLNdRÙ‡ˇ˜)'equir≥†°dONLNdWÙ˜ˇƒ).e some additional setup, but they allow you grT@°dONLNdÖÙ≈ˇÙ)Œ eater contr[°dONLNdêÙÙˇ)/ol and °dONLNdóä ç(ärE°dONLNdòé ∫)    eturn mor™†°dONLNd°∫ ¯),e information.°dONLNd∞ä–(äThe high-level ry °dONLNd¿–ˇ)F outines dif¢‡°dONLNdÀˇÑ)/ fer in form, but the low-level r@°dONLNdÎÖı)Üoutines all have the form:,
  3603. Courier.°dONLNd)ä5¿(2ä    FUNCTION °dONLNd)¿5)6
  3604. PBRoutineName°dONLNd&)5™)N (paramBlock: ParmBlkPtr; °dONLNdL7C§+ async: Boolean): OSErr;°dONLNddPä[¶(XäThe fi°dONLNdjP¶[Ë)rst parameter °dONLNdxOË[$)B
  3605. paramBlock°dONLNdÇP$[⁄)<& is a Device Manager parameter block. R`°dONLNd®P⁄[·)∂Yg`°dONLNd©P‡[) ou can use .°dONLNd¥\ägê(däfiå¿°dONLNd∂\êg„)elds of this data strV °dONLNdÀ\‰g˚)Tuctur‹°dONLNd–\˚g5)
  3606. e to pass morh °dONLNd›\6g);2e complete information to the driver than you can °dONLNdhäs”(päwith high-level rİdONLNd h‘sõ)J.outines, and the driver uses the same data strÚİdONLNdNhõs≤)«ucturx`°dONLNdSh≥s)e to pass information °dONLNditä(|äback. The section “Data StrㆰdONLNdÑt)wucturİdONLNdât9)es,” on fl°dONLNdët9Y) page 1-
  3607. ¿°dONLNdòtZd)!14
  3608. ¿°dONLNdötd´)
  3609. , discusses the fi1°dONLNd¨t´ )Gelds of the parameter °dONLNd¬ÄäãÀ(àäblock in detail.ˇ˛ˇ˛.°dONLNd”íäùÓ*The second parameter ˇ˝ˇ¸˙°dONLNdËëÔù
  3610. )easyncˇ˛ˇ˛˙°dONLNdÌí
  3611. ù,) specifi¯°dONLNdıí-ù) 1es whether the Device Manager should execute the ˇˇŒ°dONLNd&ûä©é(¶ärR`°dONLNd'ûé©–)outine asynchrÚ—°dONLNd5û–©Ú)Bonously◊°dONLNd<ûÒ©x)!. If you set this parameter to ˇˇú"yà°dONLNd[ùy©ó)àFALSEˇˇŒyà°dONLNd`ûó©), the Device Manager adds .°dONLNdz™äµ"(≤ä#the parameter block to the driver rÜ¿°dONLNdù™"µ)ò6equest queue and waits until the driver completes the °dONLNd”∂ä¡ç(æärE°dONLNd‘∂é¡P)+equest (which means it has completed all pr0¿°dONLNdˇ∂P¡ü)¬eviously queued r’İdONLNd∂ü¡‹)Oequests) beforx‡°dONLNd∂›¡Ë)>e ráİdONLNd!∂Ë¡)     eturning °dONLNd*¬äÕ†( äcontr>İdONLNd/¬°Õ)ol to your application. ˇˇ.°dONLNdH‘äfl«(‹äIf you set the ˇ˛""ƒD°dONLNdW”«flÂ)=asyncˇˇƒD°dONLNd\‘Âfl$) parameter to ˇ˛""˜w°dONLNdj”$fl<)?TRUEˇˇ˜w°dONLNdn‘<fl)., the Device Manager adds the parameter block .°dONLNdú‡äΫ(Ëäto the driver r≥İdONLNd´‡«Î)=equest queue and r” °dONLNdΩ‡ÎP)T eturns contr%¿°dONLNd…‡QÎÍ)6"ol to your application immediately∂†°dONLNd·ÈÎ )ò
  3612. . In this ˇˇÕ.°dONLNdıÏ䘙(Ùäcase, a ˇ˛1ö±ö°dONLNd˝Ι˜») noErrˇˇÕ±ö°dONLNdÏ»˜Œ) rú«°dONLNdÏŒ˜)esult code signifiŒa°dONLNdϘQ)K
  3613. es that the rÎ(°dONLNd#ÏQ˜)8-equest was successfully queued, not that the .°dONLNdP¯äç(ärE°dONLNdQ¯é,)#equest was successfully completed. ó°dONLNdt¯,2)ûYWİdONLNdu¯2)2our application can determine when the driver has .°dONLNdßä”( äcompleted the rR`°dONLNd∂”t)I#equest by periodically polling the R`°dONLNdŸt§)°ioResultR`°dONLNd·§Æ)0 fiR`°dONLNd‰Æ)
  3614. eld of the parameter .°dONLNd˘ä0(ä%block. The Device Manager sets this fiM‡°dONLNd1É)ßeld to 1 when the rπ@°dONLNd2É)R!equest is queued, and the driver °dONLNdSä'ö($ästor9‡°dONLNdWõ'◊)es the actual r°dONLNdfÿ')=esult code ther´°dONLNdu'Ü)@e when it completes the r<°dONLNdéá'¶)oequest.ˇˇËZ.°dONLNdñ.ä9ë(6äYï°dONLNdó.ê9Œ)ou can also pr n°dONLNd•.œ9-)?ovide a pointer to a ˇˇÏK.™0°dONLNd∫.-9Ñ)^completion routineˇˇËZ.
  3615. ª°dONLNdÃ.Ö9¶)X in the ˇˇ–¥Δ…°dONLNd‘-¶9Ó)! ioCompletionˇˇËZΔ…°dONLNd‡.Ó9˜)H fiØ#°dONLNd„.¯9)
  3616. eld of .°dONLNdÍ:äEÑ(Bä7the parameter block. The Device Manager executes this rj¿°dONLNd    !:ÑEÏ)˙outine when the driver °dONLNd    8FäQÏ(Näcompletes the asynchr∏`°dONLNd    MFÏQ
  3617. )bonous r˝‡°dONLNd    TF
  3618. Q.)!equest. 
  3619. °dONLNd    ]_äi∞(fäASSEMBLÛ °dONLNd    d_∞iµ)&Y€7°dONLNd    e_µi˝)-LANGUAGE NOTE
  3620. °dONLNd    tjäuê(räY@İdONLNd    ujêu)ou can call a Device Manager rÊ °dONLNd    ìjuX)áoutine asynchrL†°dONLNd    °jYu|)Bonously®‡°dONLNd    ®j{uø)", bypassing the °dONLNd    ∏väÅç(~ärE°dONLNd    πvéÅ™)Bequest queue, by setting the immediate bit (bit 9) of the trap wor`‡°dONLNd    ˚v™Åµ(~™d. °dONLNd    ˛Çäç≥(ääHowever †°dONLNd
  3621. Ç≥çª)), r—†°dONLNd
  3622. Ǫçç)-emember that the driver might have an asynchrsİdONLNd
  3623. 5Çéç´)”onous °dONLNd
  3624. ;éäôç(ñärE°dONLNd
  3625. <ééôr)3equest pending. In fact, if you make an immediate r%@°dONLNd
  3626. oérô≤)‰equest during °dONLNd
  3627. }öä•¢(¢äinterr°dONLNd
  3628. Éö£•7)"upt time, the driver might be curr¡ °dONLNd
  3629. •ö7•°)îently executing another °dONLNd
  3630. Ω¶ä±ç(ÆärE°dONLNd
  3631. æ¶é±À)equest. Be surf`°dONLNd
  3632. öÀ±)=e the driver is rQ°dONLNd
  3633. ›¶±´)C%eentrant—that is, that it can handle °dONLNd ≤äΩ—(∫äthese situations.,
  3634.  
  3635. Zapf Dingbats
  3636. ÅİdONLNdˇˇ)Juˇt@ˇ ˇˇˇˇ@
  3637. ˇ·ˇ‚7^
  3638. 4*\˜, Palatino
  3639. .+l"CHAPTER œ´)\1,     Helvetica
  3640.     (@lThe Device Manager4⁄*˙¯
  3641. (‡*1 )-c)8
  3642.     )9Using the Device Manager
  3643. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3644. 1/91(¯l Second line.4^*¿¯
  3645. m*s¯4n*s¯ nln¯
  3646. ˇ·ˇ‚7^
  3647. ˇˇ◊ˇ◊°dONLNd]lmk(il"Opening and Closing Device Driversˇˇˇˇˇˇ•(i1
  3648. °dONLNd#tlr(|lY@İdONLNd$trÌ)ou must open a driver befor„ °dONLNd?tÌÊ){7e your application can communicate with it. The Device .°dONLNdvÄlã°(àl
  3649. Manager prR`°dONLNdÄİã—)5
  3650. ovides thr$¿°dONLNdäÄ—ãá)0)ee functions for opening device drivers: ,
  3651. Courier$¿°dONLNd≥áã√)∂
  3652. OpenDriverg`°dONLNdΩĬã»);, g`°dONLNdø»ãÏ)PBOpeng`°dONLNd≈ÄÏãÚ)$, °dONLNd«ålóÄ(îland °dONLNdÀãÄó∞)OpenSlot°dONLNd”å∞ó')0. Each of these functions rR`°dONLNdÓå'ó>)wequir$¿°dONLNdÛå>ó¶)es a driver name and r˜ °dONLNd    å•óÏ)geturns a driver .°dONLNdòl£o(†lrE°dONLNdòp£Ä)eferÒ °dONLNdòÄ£π) ence numbery°dONLNd)òπ£ª)9.°dONLNd+™lµs(≤lA∫†°dONLNd,™sµu) :†°dONLNd-™vµ≠) driver name°dONLNd8™≠µfi)7H consists of a period (.) followed by any sequence of 1 to 254 printing ˇˇí˛.°dONLNdÄ∂l¡›(ælcharacters; for example, ˇˇ%¸8˙°dONLNdôµfi¡ˆ)r.ATPˇˇí˛ Z°dONLNdù∂ˆ¡†)& is the name of one of the high-level ◊˰dONLNd√∂ü¡¬)©AppleTÏ˰dONLNd…∂¡¡˜)" alk drivers.
  3653. Œ*€¯4œ*⁄¯
  3654. .°dONLNdˇˇ(÷lNOTE
  3655. ˇ·ˇ‚7^
  3656. °dONLNd÷Ÿl‰î* BThe initial period in a driver name allows the Device Manager and ˇ˛ú⁄.°dONLNdÂl∫* the File Manager¸T°dONLNd(Âπ)M, which both use the ˇ˝9¥ ñ°dONLNd=‰:)]PBOpenˇ˛ú⁄ ñ°dONLNdCÂ:§)$ function, to distinguish .°dONLNd]Òl¸    (˘l!between device driver names and fi¸@°dONLNdÒ    ¸s)ùle names. For the same rŒÄ°dONLNdóÒt¸í)keason, °dONLNdû˝lr(lfiå¿°dONLNd†˝rπ)lenames should y‡°dONLNdØ˝∫«)HnotÕ °dONLNd≤˝«)
  3657.  start with a period.,
  3658.  
  3659. Zapf Dingbats
  3660. 冰dONLNdˇˇ)]u
  3661. °dONLNd›l`(l5The Device Manager assigns each open device driver a ¬°dONLNd`œ)Ùdriver reference numberL¿°dONLNd)œ—)o.ÿ°dONLNd*—È) This °dONLNd0l&_(#l5number allows the Device Manager to locate the driverè`°dONLNde`&ü)Ù’s device contr°dONLNdt†&Ù)@ol entry in the unit °dONLNdâ'l2É(/ltable.ˇˇÓx.°dONLNdê9lDÄ*The ˇˇ‹nx°dONLNdî8ÅDΩ)
  3662. OpenDriverˇˇÓxnx°dONLNdû9ΩDá)<, function, which is the high-level opening rΔ °dONLNd 9áD˜) outine, takes the driver .°dONLNd„ElP•(Ml
  3663. name as its fi Ä°dONLNdÒE¶P˚):rst parameter and rU†°dONLNdE˚PK)Ueturns the driver rÂ`°dONLNdEKP[)PeferëİdONLNdE\P—)ence number in its second °dONLNd5Ql\ô(Yl    parameterS†°dONLNd>Qô\õ)-.ˇˇàç.°dONLNd@clnõ(kl Listing 1-1ç°dONLNdKcún)0 shows how to use the ˇˇ;€°dONLNdabn>)f
  3664. OpenDriverˇˇàç;€°dONLNdkc>n∫)< function to open a driver frAâ°dONLNdàc∫n÷)|om a r%°dONLNdéc÷nÌ)esour˜c°dONLNdìcÏn˜)ce .°dONLNdñolzr(wlfiå¿°dONLNdòorz|)le.
  3665. ù*†¯4ù*†¯"ù*a
  3666. ˇ·ˇ‚7^
  3667.     °dONLNdˇˇ(öl Listing 1-1°dONLNdúí∞ùW)D)Opening a device driver from a resource fi°dONLNdΔíXù_)®le
  3668. .°dONLNd…™l∂Ñ(≥lVAR °dONLNdŒ™Ñ∂Δ) gDrvrRefNum°dONLNd‹™Δ∂)B
  3669. : Integer;°dONLNdÁƒl–ˆ(ÕlPROCEDURE MyOpenDriver;°dONLNd“~fiê+VAR°dONLNd ‡êÏ∫+drvrHdl°dONLNd‡∫Ï)*    : Handle;°dONLNd$Óê˙¥(˜êdrvrID°dONLNd,Ó¥˙)$
  3670. : Integer;°dONLNd<¸êÃ(ê
  3671. tempDrvrID°dONLNdG¸Ã)<
  3672. : Integer;°dONLNdW
  3673. ê¿(êdrvrType°dONLNd`
  3674. ¿¸)0
  3675. : ResType;°dONLNdpê$¿(!êdrvrName°dONLNdy¿$ˆ)0    : Str255;°dONLNdà&ê2¢(/êerr°dONLNdé&Δ2ˆ)6: OSErr;°dONLNdûB~Nú(K~BEGIN°dONLNd©Pê\Ä+(tempDrvrID := FindEmptySpaceInUnitTable;°dONLNdŸlêx§*.drvrHdl := GetNamedResource('DRVR','.DRIVER');ˇ&@ˇ ˇˇˇˇ@
  3676. ˇ·ˇ‚7^
  3677. 4H\, Palatino
  3678. .+ä"CHAPTER œ´)\1,     Helvetica
  3679.     (@äThe Device Manager4⁄ä˙(‡äUsing the Device Manager
  3680. 
  3681. ‡(‡1ù)-‡)9
  3682. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3683. 1/91(¯ä Second line.4^H¿,
  3684. Courier
  3685. .°dONLNd\ÆhŒ(eÆ0GetResInfo(drvrHdl, drvrID, drvrType, drvrName);°dONLNd6jÆv™**SetResInfo(drvrHdl, tempDrvrID, drvrName);°dONLNdhÜÆí§*)err := OpenDriver('.DRIVER',gDrvrRefNum);°dONLNdô¢ÆÆ,*IF (err = NoErr) THEN°dONLNdµ∞¿ºP+DetachResource(drvrHdl);°dONLNd÷ÃÆÿº(’Æ-drvrHdl := GetNamedResource('DRVR',drvrName);°dONLNd    ⁄ÆÊå*%SetResInfo(drvrHdl,drvrID, drvrName);°dONLNd3ËúÙ¥(ÒúEND;°dONLNd8ä ü(    äThe °dONLNd<ü €)
  3686. OpenDriver°dONLNdF€ 1)< function uses the rR`°dONLNdZ1 H)Vesour$¿°dONLNd_H ¶)ce ID of the driver r˜ °dONLNdt• º)]esour…İdONLNdyº )ce to determine .°dONLNdâ
  3687. ä†(äwher7°dONLNdç
  3688. ° )e in the unit table to storà¿°dONLNd®
  3689.  Y)ke the device contr °dONLNd∫
  3690. Zπ)Nol entry for the driver`°dONLNd—
  3691. π¸)_. Unfortunately†°dONLNd‡
  3692. ˚)B, the .°dONLNdÊä$Δ(!ä
  3693. OpenDriver°dONLNdΔ$ª)<7 function does not check to see if another device contrR`°dONLNd'ª$˚)ıol entry is alr$¿°dONLNd6˚$)@eady .°dONLNd;%ä0:(-ä+located in that position in the unit table.ˇˇÊß.°dONLNdg7äB†*TherR`°dONLNdk7†B≤)efor$¿°dONLNdo7≤Bœ)e, the ˇˇÕNÚ°dONLNdv6œB) MyOpenDriverˇˇÊßÚ°dONLNdÇ7B#)H pr´°dONLNdÖ7$BA)
  3694. ocedur}u°dONLNdã7AB|)
  3695. e begins by fi1j°dONLNdô7}B)<!nding an empty space in the unit .°dONLNd∫CäN(Kätable and then changes the rc°dONLNd÷CN)|esour´@°dONLNd€CNt)ce ID of the driver rE‡°dONLNdCuNç)Wesouré °dONLNdıCçNØ)ce befor'†°dONLNd˝C∞NÁ)#e calling the .°dONLNd NäZΔ(Wä
  3696. OpenDriver°dONLNdOΔZC)< function. (The chapter “W¬†°dONLNd/OBZ_)|riting ï°dONLNd6O_Zf)Y™°dONLNd7OeZ¸)our Own Device Driver” gives a °dONLNdV[äf»(cä complete defi°dONLNdc[»f)>nition of the °dONLNdqZfõ)=FindEmptySpaceInUnitTable°dONLNdä[õf…)ñ  function.)°dONLNdñmäx(uäAfter the driver is open, the °dONLNd¥lxZ)à MyOpenDriver°dONLNd¿mZxg)H prR`°dONLNd√mgxÑ)
  3697. ocedur$¿°dONLNd…mÑxœ)e detaches the r˜ °dONLNdŸmŒxÂ)Jesour…İdONLNdfimÂx)ce and .°dONLNdÂyäÑç(ÅärE°dONLNdÊyéÑ£)estor»Ä°dONLNdÎy£ÑÁ)es the original rs@°dONLNd¸yËÑ)EesourªÄ°dONLNdyÑ)ce ID..°dONLNdãäñü(ìäThe °dONLNd äüñ√)PBOpen°dONLNdã√ñ⁄)$ and °dONLNdä⁄ñ
  3698. )OpenSlot°dONLNdã
  3699. ñf)0 functions, which arR`°dONLNd3ãfñ)\&e low-level functions, use the Device .°dONLNdYó䢰(üä>Manager parameter block, which is described fully in “Data StrØ@°dONLNdóó°¢∏(ü°uctur5 °dONLNdúóπ¢◊)es” on dž°dONLNd£ó◊¢˜)page 1-±`°dONLNd™ó˜¢) 14±`°dONLNd¨ó¢)
  3700. . ˇ˛ñï.°dONLNdÆ£äÆ™(´äCBoth of these functions expect a pointer to the driver name in the ˇ˝-*%ë°dONLNdÒ¢´Æ·(´´    ioNamePtrˇ˛ñï%ë°dONLNd˙£·ÆÈ)6 fiº&°dONLNd˝£ÈÆ) eld of the °dONLNdØä∫(∑äparameter block and rR`°dONLNdØ∫!)f eturn the r$¿°dONLNd(Ø!∫3)1efer˜ °dONLNd,Ø2∫ä)ence number in the ˜ °dONLNd?Æä∫∫)XioRefNum˜ °dONLNdGØ∫∫ƒ)0 fi˜ °dONLNdJ؃∫Ÿ)
  3701. eld. ˇˇ{é°dONLNdP¡äÃë(…äYï°dONLNdQ¡êÃø) ou use the ˇ˛˜™°dONLNd\¿¿É)0PBOpenˇˇ{é™°dONLNdb¡‰Ã˘)$ and ˇ˛˜˛Δ°dONLNdg¿˘Ã))OpenSlotˇˇ{é˛Δ°dONLNdo¡)Ãk)0 functions in prC–°dONLNd¡lÃ~)Cefer0°dONLNdÉ¡~ñ) ence to the ˇ˛˜à⁄°dONLNd迱ÃÌ)3
  3702. OpenDriverˇˇ{éà⁄°dONLNdô¡ÌÃ)<
  3703.  function .°dONLNd£Õäÿ„(’äwhen you want morH`°dONLNd¥Õ‰ÿ)Ze contrPİdONLNdªÕÿ¸)6ol over how the Device Manager opens the device driverŸ¿°dONLNdÒÕ˚ÿ)˘. For .°dONLNd˜Ÿä‰(·äexample, you can set rR`°dONLNd
  3704. Ÿ‰›)f2ead and write permissions for the device with the R`°dONLNd?ÿ›‰)Ì    ioPermssnR`°dONLNdHŸ‰)6 .°dONLNdIÂäê(Ìäfiå¿°dONLNdKÂê)eld of the parameter block..°dONLNdg˜äë(ˇäYï°dONLNdh˜ê¡) ou use the ï°dONLNdsˆ¡Ò)1OpenSlotï°dONLNd{˜Ò)0A function to open drivers that serve slot devices. This function .°dONLNdºä}( ä6uses an extended parameter block that includes extra fi®¿°dONLNdÛ}≠)Û elds specifi°†°dONLNdˇÆÒ)1c to slot device .°dONLNdä±(ä    drivers. R`°dONLNd±∏)'Yg`°dONLNd∑Ë) ou use the g`°dONLNd%Ë )1PBOpeng`°dONLNd+ œ)$+ function to open any other device drivers..°dONLNdW!ä,ê()äY@İdONLNdX!ê,.)"ou must open device drivers synchríİdONLNdz!.,Q)ûonouslyÓ¿°dONLNdÅ!P,∏)". If a device driver is alr˚°dONLNdú!∏,˚)heady open, the °dONLNd´-ä8•(5ädriver´†°dONLNd±-•8”)
  3705. -opening r†°dONLNdª-”8).outines simply rW`°dONLNdÀ-8g)Heturn the driver r™ °dONLNd›-g8w)LeferV@°dONLNd·-x8±) ence numberfi °dONLNdÏ-∞8≤)8.°dONLNdÓ?äJ°(GäThe rÄ¿°dONLNdÛ?°J)emaining Device Manager rG`°dONLNd ?JB){    outines r ¿°dONLNd?CJZ)'equir#°dONLNd?ZJfi)e your application to use the r    ‡°dONLNd9?fiJÓ)Ñefer∂°dONLNd=?ÓJ)ence °dONLNdBKäV¨(Sänumber≥°dONLNdHK¨VI)"$, instead of the driver name, when rH‡°dONLNdlKJV°)ûeferring to a device.°dONLNdÇ]äh√(eä When you arΩ °dONLNdç]√h )9e done using a driver€‡°dONLNd¢] hø)]#, you may want to close it. HoweveryİdONLNd≈]øh¯)ü
  3706. , you should °dONLNd“iät(qäYgenerally not close drivers that might be needed by the system or by other applications. °dONLNd    +uäÄ¥* BWhether you should close a particular driver depends on the driver¡ °dONLNd    mu¥Äπ(}¥. ìİdONLNd    ouπÄø)YT°dONLNd    puøÄ    )ou should check °dONLNd    ÄÅäåB(âä*the documentation for the driver if you ar†°dONLNd    ™ÅCåi)π    e not surd†°dONLNd    ≥Åiå¬)&e. Other chapters in ì@°dONLNd    »Å¬å)YInside Macintoshu@°dONLNd    ÿÅå
  3707. )F °dONLNd    Ÿçäò*(ïä%give this information for the standar¶¿°dONLNd    ˛ç*òÖ)†d Macintosh drivers.ˇ‰@ˇ ˇˇˇˇ@
  3708. ˇ·ˇ‚7^
  3709. 4*\˜, Palatino
  3710. .+l"CHAPTER œ´)\1,     Helvetica
  3711.     (@lThe Device Manager4⁄*˙¯
  3712. (‡*1 )-c)10
  3713.     )9Using the Device Manager
  3714. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3715. 1/91(¯l Second line.4^*¿¯
  3716. ˇˇ˚‘.°dONLNd]lh¸(el If you do want to close a driver•l°dONLNd ]¸h)ê, you can use the high-level ,
  3717. Courierˇˇ˜®åd°dONLNd=\Äh¬)Ñ CloseDriverˇˇ˚‘åd°dONLNdH]¬h˜)B
  3718.  function or ˇˇíG°dONLNdUilt≠(qlthe low-level ˇˇ$é§é°dONLNdch≠t◊)APBCloseˇˇíG§é°dONLNdji◊t)*  function. …°dONLNduit2), Listing 1-2[c°dONLNdÄi3tô)0 shows how to use the ˇˇ$é…
  3719. °dONLNdñhôt√)fPBCLoseˇˇíG…
  3720. °dONLNdùi√t˜)*
  3721.  function to .°dONLNd™ulÄ·(}lclose the driver opened in Ω °dONLNd≈u·Ä)u Listing 1-1]`°dONLNd–uÄ)/.
  3722. ¢*¶¯4£*•¯"£*a
  3723. ˇ·ˇ‚7^
  3724.     °dONLNdˇˇ(†l Listing 1-2°dONLNd“ò∞£ )DClosing a device driver
  3725. .°dONLNdÍØlª¸(∏lPROCEDURE MyCloseDriver;°dONLNdΩ~…ê+VAR°dONLNdÀê◊Ã+
  3726. paramBlock°dONLNdÀÃ◊,)<: ParamBlockRec;°dONLNd1Ÿê¢(‚êerr°dONLNd7ŸΔˆ)6: OSErr;°dONLNdEı~ú(˛~BEGIN°dONLNdPê+paramBlock.ioCompletion°dONLNdhD)ä:= nil;°dONLNduê(êparamBlock.ioRefNum°dONLNdä\)r:= gDrvrRefNum;°dONLNd°-ê9h(6ê$err := PBClose (@paramBlock, FALSE);°dONLNd ;~Gñ(D~END;°dONLNdœTl_Å(\lThe °dONLNd”SÅ_œ)
  3727. MyCloseDriver°dONLNd‡Tœ_‹)N prR`°dONLNd„T‹_˘)
  3728. ocedur$¿°dONLNdÈT˘_)e specifi$¿°dONLNdÚT_õ)&es the driver to close by pr˜ °dONLNdTö_Û){oviding the driver ˇˇÜɰdONLNd!`lkp(hlrR`°dONLNd"`pkÇ)efer$¿°dONLNd&`Çkÿ)ence number in the ˇˇ
  3729. >ðdONLNd9_ÿk)VioRefNumˇˇÜÉ>ðdONLNdA`k)0 fi≈O°dONLNdD`k˜)    2eld of the parameter block and indicates that the °dONLNdvllwS(tl0Device Manager should not execute a completion rR`°dONLNd¶lSw≤)Áoutine by specifying R`°dONLNdªk≤wƒ)_NILÙ°dONLNdæl√wÂ) in the °dONLNdΔwlÉ¥(Äl ioCompletion°dONLNd“x¥ɪ)H fPİdONLNd‘xªÉA)ield of the parameter block. 
  3730. ©*د4©*Ư ©l©¯
  3731. ˇ·ˇ‚7^
  3732. ˇˇ◊.ˇ◊°dONLNdÚòl®(§lCommunicating WÜù°dONLNdò®m)Ñith Device Driversˇˇˇˇˇˇ•(§1
  3733. °dONLNdØl∫(∑l(Once a driver is open and you have its rfl@°dONLNd<Ø∫,)∞eferã`°dONLNd@Ø-∫f) ence number@°dONLNdKØf∫Ï)9, you can use Device Manager °dONLNdhªlΔ∑(√lcommunication rıİdONLNdwª∑Δg)K(outines to exchange information with it.°dONLNd†Õlÿ\(’l4When you want to send information to a device driverKİdONLNd‘Õ\ÿz), you fi‰°dONLNd‹Õzÿò)rst stor臰dONLNd‰ÕôÿÛ)e the information in ˇˇæΔ.°dONLNd˘Ÿl‰õ(·l
  3734. a data bufœÏ°dONLNdŸõ‰˝)/fer and then call the ˇˇ}åâ °dONLNdÿ˛‰()cFSWriteˇˇæΔâ °dONLNd Ÿ(‰o)* function or the ˇˇ}åÑ‚°dONLNd1ÿp‰ö)HPBWriteˇˇæΔÑ‚°dONLNd8Ÿö‰˜)* function. When you .°dONLNdLÂlî(Ìl    want to rg†°dONLNdUÂî)(eceive information fró†°dONLNdjÂB)\om a device driver™‡°dONLNd|ÂB`)R, you fiC`°dONLNdÑÂaø)rst allocate a data bufã°dONLNdõÂøÔ)^ fer to hold .°dONLNdßÒl¸(˘l#the information, and then call the °dONLNd ¸3)£FSRead°dONLNd–Ò3¸B)$ or °dONLNd‘B¸f)PBRead°dONLNd⁄Òf¸ì)$  function. R`°dONLNdÂÒì¸ö)-Yg`°dONLNdÊÒô¸ı)ou must specify the .°dONLNd˙˝l    (l"number of bytes you want transferr®Ä°dONLNd˝    µ)ù'ed when calling any of these functions.ˇ˛ß“.°dONLNdDl√(lLike all low-level rI÷°dONLNdXƒ˙)X
  3735. outines, the ˇ˝O§ôz°dONLNde˙$)6PBWriteˇ˛ß“ôz°dONLNdl$8)* and ˇ˝O§È°dONLNdq8\)PBReadˇ˛ß“ȰdONLNdw\˜)$% functions allow you to transfer the .°dONLNdúl&Δ(#linformation asynchr_İdONLNdØΔ&È)Zonouslyª¿°dONLNd∂Ë&ã)"%, and with these functions you can pr?¿°dONLNd€å&„)§ovide a completion °dONLNdÓ'l2o(/lrE°dONLNdÔ'p2ç)@outine. These functions also allow you to specify a drive numberÓ¿°dONLNd/'å2Î(/å, a positioning mode, ˇ˛»l.°dONLNdE3l>ƒ(;land a positioning of´§°dONLNdY3ƒ>Û)X fset in the ˇ˝êÿ˰dONLNde2Ù>*)0    ioVRefNumˇ˛»l˰dONLNdn3*>.)6, ˇ˝êÿÕT°dONLNdp2.>d)    ioPosModeˇ˛»lÕT°dONLNdy3d>{)6, and ˇ˝êÿ^,°dONLNd2|>æ) ioPosOffsetˇ˛»l^,°dONLNdä3æ>Δ)B fi&ò°dONLNdç3«>¯)     elds of the .°dONLNdô?lJfi(GlPparameter block. The Device Manager uses the positioning mode and positioning of!‡°dONLNdÈ?flJÒ(Gflfset °dONLNdÓKlVΩ(Slto determine wher*@°dONLNdˇKæVu)R+e on a block device the transfer will occur†‡°dONLNd*KtV◊)∂. The Device Manager °dONLNd?Wlb=(_l.simply passes the drive number onto the driver¢ °dONLNdmW=b])—. Be sur†°dONLNduW^bÂ)! e you specify these values in a °dONLNdïcln4(kl,manner compatible with the particular driverëİdONLNd¡c4n6)».°dONLNd√ulÄ€(}lThe Device Manager defiè@°dONLNd⁄u€Ģ)ones thr¿°dONLNd·u˘Ä¶)'ee positioning modes for block devices:,
  3736.  
  3737. Zapf Dingbats
  3738. °dONLNd    âlêq(èln
  3739. °dONLNd áxí®) At the currñ°dONLNdá®íÎ)0ent position. Wu`°dONLNd%áÎí¨)C.ith this mode, the transfer begins at the curr∞@°dONLNdSá¨í)¡ent position on °dONLNdcìxû˜(õxthe medium—typically wher`°dONLNd|ì¯ûd)Äe the last transfer ended.
  3740. °dONLNdóßlÆq(≠ln
  3741. °dONLNdô•x∞É) OfÇ °dONLNdõ•É∞ú) fset fr∑‡°dONLNd¢•ú∞O)(om the start. This mode allows you to præÄ°dONLNd •O∞Ø)≥ovide a positioning of@°dONLNd‡•∞∞‚)a fset, which °dONLNdϱxºî(πxspecifiÓ °dONLNdÛ±îº˝)es at how many bytes fr °dONLNd    
  3742. ±˛ºı)j7om the beginning of the medium the transfer will begin.ˇ(@ˇ ˇˇˇˇ@
  3743. ˇ·ˇ‚7^
  3744. 4H\, Palatino
  3745. .+ä"CHAPTER œ´)\1,     Helvetica
  3746.     (@äThe Device Manager4⁄ä˙(‡äUsing the Device Manager
  3747. ~¿(‡1
  3748. ‡)-a¿)11
  3749. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3750. 1/91(¯ä Second line.4^H¿,
  3751.  
  3752. Zapf Dingbats
  3753. °dONLNd_äfè(eän
  3754. °dONLNd]ñh°) OfÇ °dONLNd]°h∫) fset fr∑‡°dONLNd ]∫h)om the mark. W߇°dONLNd]hm)Gith this mode you can pr†Ä°dONLNd1]mhÕ)lovide a positioning of˝@°dONLNdG]ÕhÚ)`
  3755. fset that °dONLNdQiñt≤(qñspecifiÓ °dONLNdXi≤t)es at how many bytes fr °dONLNdoitO)j om the currX°dONLNdziOtÏ)3&ent position the transfer will begin. .°dONLNd°{äÜÂ(ÉäOn completion, the ,
  3756. Courier°dONLNd¥zÂÜ    )[PBRead°dONLNd∫{    Ü )$ and °dONLNdøz ÜJ)PBWrite°dONLNdΔ{JÜ|)*  functions rR`°dONLNd“{|Ü
  3757. )2 eturn the total number of bytes ˇ˛»l°dONLNdÚáäí⁄(èäactually transferrðdONLNdá€í)Q
  3758. ed in the ˇ˝êÿt°dONLNdÜí@))
  3759. ioActCountˇ˛»lt°dONLNdá@íH)< fi<|°dONLNdáIí)    /eld of the parameter block. For block devices, °dONLNdJìäûÎ(õäthese functions also rR`°dONLNd`ìÎûb)aeturn a new positioning of$¿°dONLNdzìbûï)w fset in the $¿°dONLNdÜíïû◊)3 ioPosOffset$¿°dONLNdëì◊û·)B fi$¿°dONLNdîì·ûÛ)
  3760. eld..°dONLNdô•ä∞¯(≠äCertain device drivers pr⁄†°dONLNd≤•¯∞ì)n%ovide additional abilities with the r%†°dONLNd◊•î∞Î)úeading and writing ˇˇ.°dONLNdͱäºü(πä>functions. For example, the Disk Driver allows you to use the ˇ˛"";ª°dONLNd(∞†ºƒ(π†PBReadˇˇ;ª°dONLNd.±ƒº)$ function to verify .°dONLNdBΩ仆(≈ä>that data written to a block device matches the data in memoryÒ†°dONLNdÄΩü»™(≈ü. T'`°dONLNdÉΩ™» ) o do this, you add the °dONLNdö…ä‘ç(—ärE°dONLNdõ…é‘„)ead-verify constant.°dONLNd؇äÏ(ÈäCONST rdVerify = 64;ˇˇàá°dONLNdƒ˘ä®*to the ˇˇë°dONLNdÀ¯®fi)    ioPosModeˇˇàáë°dONLNd‘˘fiÁ)6 fiï°dONLNd◊˘Ë)
  3761. Celd of the parameter block, as explained in the description of the °dONLNdäÆ(
  3762. äPBRead°dONLNd Æ()$ function in “Routines,” on °dONLNd<(I)zpage 1-°dONLNdCIS)!25°dONLNdESV)
  3763. ..°dONLNdGä"∏(ä Listing 1-3 @°dONLNdRπ"„)/A shows an example that exchanges information with a device driverÕ@°dONLNdì‚"Á(‚. 
  3764. DHH4EHG"EHa
  3765. ˇ·ˇ‚7^
  3766.     °dONLNdˇˇ(Bä Listing 1-3°dONLNdñ:ŒE\)D"Communicating with a device driver
  3767. .°dONLNdºQä],(ZäPROCEDURE MyReadFromDriver;°dONLNd‹_úkÆ+VAR°dONLNdÂmÆyÍ+
  3768. paramBlock°dONLNdmÍyJ)<: ParamBlockRec;°dONLNd{Æá¿(ÑÆerr°dONLNd {‰á)6: OSErr;°dONLNdâÆïÿ(íÆreadBuf°dONLNd#âÿï)*    : Str255;°dONLNd2•ú±∫(ÆúBEGIN°dONLNd=≥Æø8+paramBlock.ioCompletion°dONLNdU≥8øb)ä:= nil;°dONLNdb¡ÆÕ ( ÆparamBlock.ioRefNum°dONLNdw¡ Õz)r:= gDrvrRefNum;°dONLNdåœÆ€ (ÿÆparamBlock.ioBuffer°dONLNd°œ €h)r := @readBuf;°dONLNd≥›ÆÈ,(ÊÆparamBlock.ioReqCount°dONLNd…›,ÈV)~:= 256;°dONLNdÿ˘ÆÄ(Æ#err := PBRead (@paramBlock, FALSE);°dONLNdú¥(úEND;°dONLNd#ä/&(,äPROCEDURE MyWriteToDriver;°dONLNd%1ú=Æ+VAR°dONLNd.?ÆKÍ+
  3769. paramBlock°dONLNd9?ÍKJ)<: ParamBlockRec;°dONLNdOMÆY¿(VÆerr°dONLNdUM‰Y)6: OSErr;°dONLNdc[Æg“(dÆbuffer°dONLNdk[“g)$    : Str255;ˇ ¬@ˇ ˇˇˇˇ@
  3770. ˇ·ˇ‚7^
  3771. 4*\˜, Palatino
  3772. .+l"CHAPTER œ´)\1,     Helvetica
  3773.     (@lThe Device Manager4⁄*˙¯
  3774. (‡*1 )-c)12
  3775.     )9Using the Device Manager
  3776. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3777. 1/91(¯l Second line.4^*¿¯,
  3778. Courier
  3779. .°dONLNdj~vú(s~BEGIN°dONLNd xêÑ,+buffer := 'Data to Write';°dONLNd,îê†*paramBlock.ioCompletion°dONLNdDî†D)ä:= nil;°dONLNdQ¢êÆ(´êparamBlock.ioRefNum°dONLNdf¢Æ\)r:= gDrvrRefNum;°dONLNd{∞êº(πêparamBlock.ioBuffer°dONLNdê∞ºD)r := @buffer;°dONLNd°æê («êparamBlock.ioReqCount°dONLNd∑æ 2)~:= 14;°dONLNd≈⁄êÊh(„ê$err := PBWrite (@paramBlock, FALSE);°dONLNdÓË~Ùñ(Ò~END;ˇˇ°dONLNdÛl Ä(    lThe ˇ˛9‡ú°dONLNd˜Ä ‡)MyReadFromDriverˇˇú°dONLNd‡ Ï)` prå@°dONLNd
  3780. Ï     ) ocedur^†°dONLNd     ¯)6e uses a parameter block to specify the device driver .°dONLNdF
  3781. lÄ(l(by r/†°dONLNdK
  3782. Åë)efer€¿°dONLNdO
  3783. ë<)&ence number), the number of bytes to rh†°dONLNdu
  3784. =ù)¨ead, a pointer to a buf͇°dONLNdå
  3785. ù∫)`fer to rw‡°dONLNdî
  3786. ªÈ) eceive the .°dONLNdül$ú(!l
  3787. data, and °dONLNd©ú$Æ)0NIL!†°dONLNd¨Æ$
  3788. ) for the completion rÙ°dONLNd¡ $Ï)^1outine. It then sends the parameter block to the ˇˇíD°dONLNdÚ$l0ê(-lPBReadˇˇ…"°dONLNd¯%ê0˜)$L function. The Device Manager appends the parameter block to the end of the ˇˇ,ï°dONLNdD1l<â(9ldriver=`°dONLNdJ1ä<ó)’s r<U°dONLNdN1ó<1)
  3789. "equest queue. Since the parameter ˇ˛Y*>°dONLNdp02<P)õasyncˇˇ,ï>°dONLNdu1P<v)  is set to ˇ˛Y*Õí°dONLNdÄ0v<î)&FALSEˇˇ,ïÕí°dONLNdÖ1î<˜), the Device Manager °dONLNdö=lHò(El
  3790. does not rR`°dONLNd§=òH»), eturn contr$¿°dONLNdØ=»HÛ)0
  3791. ol to the $¿°dONLNdπ<ÛHS)+MyReadFromDriver$¿°dONLNd…=SH`)` pr˜ °dONLNdÃ=_H|) ocedur…İdONLNd“=|H‰)e until the driver has .°dONLNdÈIlTº(Qlcompleted every rdONLNd˙IºT)Pequest in its queue.ˇˇúÓ.°dONLNd[lfÄ(clThe ˇˇ9‹Ó°dONLNdZÅf€)MyWriteToDriverˇˇúÓÓ°dONLNd"[€fÁ)Z prå<°dONLNd%[Áf) ocedur^ú°dONLNd+[f¯)6e uses a parameter block to specify the device driver ˇ˛¥¯°dONLNdaglrÄ(ol(by rX°dONLNdfgÅrì)eferŸ∏°dONLNdjgír‰)Oence number), the size of the data to write, a pointer to the actual data, and ˇ˝i)8°dONLNdπfÂr˜(oÂNILˇ˛¥¯ ÿ°dONLNdºgˆr˜) ˇˇÉA°dONLNdΩsl~Δ({lfor the completion r‹#°dONLNd—sΔ~°)Z1outine. It then sends the parameter block to the ˇˇÇyl°dONLNdr¢~Ã)‹PBWriteˇˇÉAyl°dONLNd    sÃ~¯)*  function. .°dONLNdlä≥(álGThe Device Manager appends the parameter block to the end of the driverq¿°dONLNd[¥ä¡(ᥒs rª°dONLNd_¡ä‡)
  3792. equest ˇˇãì.°dONLNdfãlñÍ(ìlqueue. Since the parameter ˇˇ&ÆL°dONLNdÅäÍñ)~asyncˇˇãìÆL°dONLNdÜãñ0)  is set to ˇˇ&‹ò°dONLNdëä0ñN)(FALSEˇˇãì‹ò°dONLNdñãNñfi), the Device Manager does not rÙj°dONLNdµãfiñ˜)êeturn °dONLNdªól¢Ç(ülcontrR`°dONLNd¿óÇ¢≠)
  3793. ol to the R`°dONLNd ñ≠¢)+MyWriteToDriverR`°dONLNdŸó¢)Z pr$¿°dONLNd‹ó¢1)
  3794. ocedur˜ °dONLNd‚ó0¢Á)'e until the driver has completed every .°dONLNd    £lÆo(´lrE°dONLNd
  3795. £pÆ≈)equest in its queue.
  3796. ”*Ÿ¯4‘*Ÿ¯ ‘l‘¯
  3797. ˇ·ˇ‚7^
  3798. ˇˇ◊ˇ◊°dONLNd√l”î(œlContrd©°dONLNd$√î”ò)($olling and Monitoring Device Driversˇˇˇˇˇˇ•(œ1
  3799. °dONLNdI⁄lÂø(‚lIn addition to the rõ†°dONLNd]⁄øÂ)Seading and writing rπ@°dONLNdq⁄§)[outines, the Device Manager pr>İdONLNdè⁄•»)ãovides r™°dONLNdó⁄»ÂÍ)#outines °dONLNdüÊlÒ(Ól$that allow your application to contr°dONLNd√Ê    Òœ)ù-ol and monitor device drivers in other ways. .°dONLNdÒ¯lÅ(lThe °dONLNdı˜Å´)Control°dONLNd¸¯´¬)* and °dONLNd˜¬¯)    PBControl°dONLNd
  3800. ¯¯∑)6* functions allow your application to send .°dONLNd4¯∑Ÿ)øcontrol °dONLNd<l¢( l information|@°dONLNdG£”)7  to a driverP°dONLNdS”@)0. The actual type of contr”°dONLNdm@—)m!ol information to which drivers r—¿°dONLNdé—Û)ëespond °dONLNdïlí(l    varies gr‹°dONLNdûí±)&eatly fr¯`°dONLNd¶±)om driver to drivern‡°dONLNdπö)U!. For example, you can send contr‡ °dONLNd⁄öÁ)îol information to °dONLNdÏl'ù($l the standar‡°dONLNd˜û'‡)2d Disk Driver r‹ °dONLNd‡'e)B!equesting that it eject the disk..°dONLNd(.l9Å(6lThe °dONLNd,-Å9•)Status°dONLNd2.•9º)$ and °dONLNd7-º9Ï)PBStatus°dONLNd?.Ï9¥)0, functions allow your application to obtain .°dONLNdk.¥9—)»status °dONLNdr:lE¢(Bl information|@°dONLNd}:£E¨)7 fr °dONLNdÄ:≠E‡)
  3801. om a driver˙İdONLNdã:flE‰)2. ú °dONLNdç:‰Eô))Again, the type of information drivers prâ°dONLNd∂:ôEÚ)µovide varies widely °dONLNd FlQs(Nlfrò‡°dONLNdÃFsQ»)om driver to driver`°dONLNdflF»QÕ)U. ±°dONLNd·FÃQΔ)9As an example of status information, the Serial Driver pr˜†°dONLNdFΔQÌ)˙    ovides a °dONLNd#Rl]u(ZlbrưdONLNd%Ru]Ó)    eakdown of the types of err*†°dONLNd@RÔ]F)zors that have occurr˚‡°dONLNdTRF]W)Wed r&@°dONLNdXRX]w)ecentlyô@°dONLNd_Rv]x)..°dONLNdadlo»(llLike all low-level rR`°dONLNdud»o;)\outines, you can call the R`°dONLNdèc;oq)s    PBControlR`°dONLNdòdqoà)6 and R`°dONLNdùcào∏)PBStatusR`°dONLNd•d∏oÊ)0  functions .°dONLNd∞pl{é(xlasynchr$ °dONLNd∑pè{≤)#onouslyÄ`°dONLNdæp±{T)"%, and with these functions you can pr`°dONLNd„pU{∞)§ovide a completion r`°dONLNd˜p∞{—)[outine. °dONLNd    ÇlçM(äl5Because of the diversity of device drivers, the contr°dONLNd    5ÇNçı)‚%olling and monitoring functions have ˇˇW.°dONLNd    Zélô›(ñltwo general parameters: ˇ˛ÆÖ°dONLNd    rç›ô)qcsCodeˇˇWÖ°dONLNd    xéô)$ and ˇ˛Æ3#°dONLNd    }çôS)
  3802. csParamPtrˇˇWu√°dONLNd    áéRôk);. The ˇ˛Æ#—°dONLNd    ççlôê)csCodeˇˇW#—°dONLNd    ìéêô¯)$ parameter allows you .°dONLNd    ©öl•ª(¢lto specify a driver'‡°dONLNd    ºöº•è)P0-dependent code that indicates the type of contr@°dONLNd    Ïö蕬)”
  3803. ol or status .°dONLNd    ˘¶l±Ω(Ælinformation. The °dONLNd
  3804.  
  3805. •Ω±˘)Q
  3806. csParamPtr°dONLNd
  3807. ¶˘±ó)<" parameter allows you to send or rR`°dONLNd
  3808. 6¶ó±Í)ûeceive the actual .°dONLNd
  3809. H≤lΩÇ(∫lcontr>İdONLNd
  3810. M≤ÉΩÌ)ol or status information.ˇH@ˇ ˇˇˇˇ@
  3811. ˇ·ˇ‚7^
  3812. 4H\, Palatino
  3813. .+ä"CHAPTER œ´)\1,     Helvetica
  3814.     (@äThe Device Manager4⁄ä˙(‡äUsing the Device Manager
  3815. ~¿(‡1
  3816. ‡)-a¿)13
  3817. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3818. 1/91(¯ä Second line.4^H¿
  3819. °dONLNd]äh(eäNotice that although the contrt@°dONLNd]h )Ö*olling and monitoring functions have a difû°dONLNdH] h÷)ªferÄİdONLNdK]÷h) ent interface °dONLNdYiät¥(qä
  3820. than the rİdONLNdciµt
  3821. )+Leading and writing functions, their outcome is much the same: they exchange °dONLNdØuäÄú(}ä<information with device drivers. Some device drivers (AppleTp¿°dONLNdÎuúÄÁ(}úalk, for instance) °dONLNd˛Åäå/(âä#implement all communication, even rÛ°dONLNd!Å/åï)•eading and writing, thr§`°dONLNd8Åñå÷)gough the contr`°dONLNdFÅ◊å)A olling and °dONLNdQçäòÍ(ïämonitoring functions.°dONLNdgüä™x*4The sample device driver described in the chapter “W˛¿°dONLNdõüw™ë)Ìriting ∑`°dONLNd¢üí™ò)Yw‡°dONLNd£üò™)our Own Device Driver” °dONLNd∫´ä∂√(≥ä
  3822. accepts contrÍ °dONLNd«´√∂)9ol and status r°dONLNd÷´∂')?    equests. o‡°dONLNdfl´(∂V)& Listing 1-4 °dONLNdÍ´W∂£)/ shows how to prD‡°dONLNd˙´£∂’)L ovide contrl‡°dONLNd´’∂fl)2ol °dONLNd∑䬵(øäCinformation and determine status information for that device driverŰdONLNdK∑µ¬∑(øµ.
  3823. ‰HË4ÂHÁ"ÂHa
  3824. ˇ·ˇ‚7^
  3825.     °dONLNdˇˇ(‚ä Listing 1-4°dONLNdM⁄ŒÂt)D*Controlling and monitoring a device driver,
  3826. Courier
  3827. .°dONLNd{Òä˝D(˙äPROCEDURE MyIssueDriverControl;°dONLNdüˇú Æ+VAR°dONLNd®
  3828. ÆÍ+
  3829. paramBlock°dONLNd≥
  3830. ÍJ)<: ParamBlockRec;°dONLNd…Æ'¿($Æerr°dONLNdœ‰')6: OSErr;°dONLNd›7úC∫(@úBEGIN°dONLNdËEÆQ8+paramBlock.ioCompletion°dONLNdE8Qb)ä:= nil;°dONLNdSÆ_&(\ÆparamBlock.ioCRefNum°dONLNd$S&_Ä)x:= gDrvrRefNum;°dONLNd9aÆm(jÆparamBlock.csCode°dONLNdMam>)f:= 100;°dONLNdZoÆ{,(xÆparamBlock.csParam[0]°dONLNdqo,{J)~:= 3;°dONLNdxoJ{™){ beep 3 times }°dONLNdíãÆóí(îÆ&err := PBControl (@paramBlock, FALSE);°dONLNdΩôú•¥(¢úEND;°dONLNdΔµä¡2(æäPROCEDURE MyGetDriverStatus;°dONLNdÁ√úœÆ+VAR°dONLNd—Æ›Í+
  3831. paramBlock°dONLNd˚—Í›J)<: ParamBlockRec;°dONLNdflÆο(ËÆerr°dONLNdfl‰Î)6: OSErr;°dONLNd%ÌÆ˘‰(ˆÆ    beepTimes°dONLNd/̉˘ )6
  3832. : Integer;°dONLNd?    ú∫(úBEGIN°dONLNdJÆ#8+paramBlock.ioCompletion°dONLNdb8#b)ä:= nil;°dONLNdo%Æ1&(.ÆparamBlock.ioCRefNum°dONLNdÑ%&1Ä)x:= gDrvrRefNum;°dONLNdô3Æ?(<ÆparamBlock.csCode°dONLNd¨3?>)f:= 100;°dONLNdªOÆ[å(XÆ%err := PBStatus (@paramBlock, FALSE);°dONLNdËkÆw,*IF (err = noErr) THEN°dONLNdy¿Öí+#beepTimes := paramBlock.csParam[0];°dONLNd,áúì¥(êúEND;ˇˇ\Ô°dONLNd1†ä´û(®äThe ˇ˛πfi‹Ô°dONLNd5üû´)MyIssueDriverControlˇˇ\Ô‹Ô°dONLNdI†´")x pr >°dONLNdL†#´@)
  3833. ocedurfiû°dONLNdR†?´∫)e begins by setting up the fi 8°dONLNdo†ª´)|elds of a parameter °dONLNdɨä∑Ω(¥ä block. The °dONLNdé´Ω∑Û)3    ioCRefNum°dONLNdó¨Û∑˝)6 fi°dONLNdö¨˝∑-)
  3834.  
  3835. eld specifi°dONLNd•¨-∑ë)0es the device driver rR`°dONLNdª¨ë∑£)defer$¿°dONLNdø¨£∑)ence number and the ˇ®@ˇ ˇˇˇˇ@
  3836. ˇ·ˇ‚7^
  3837. 4*\˜, Palatino
  3838. .+l"CHAPTER œ´)\1,     Helvetica
  3839.     (@lThe Device Manager4⁄*˙¯
  3840. (‡*1 )-c)14
  3841.     )9Reference to the Device Manager
  3842. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3843. 1/91(¯l Second line.4^*¿¯,
  3844. Courier
  3845. .°dONLNd\lh¥(el ioCompletion°dONLNd ]¥hª)H fPİdONLNd]ªhÏ) ield specif!°dONLNd]Ïh¸)1ies !°dONLNd\¸h)NIL¬†°dONLNd ]
  3846. hl) for the completion rï°dONLNd5]lh£)_ outine. The ï°dONLNdA\£h«)7csCodeï°dONLNdG]«hŒ)$ feİdONLNdI]Œh‰)ield .°dONLNdNiltà(qlspecifiÓ °dONLNdUiàt‹)es the type of contr˜@°dONLNdii‹t )T6ol information being sent. The sample device driver fr‡°dONLNdüi tÎ)Óom the °dONLNd¶ulÄû(}l
  3847. chapter “WÖ°dONLNd∞uûÄ∏)2riting =†°dONLNd∑uπÄø)Y˛ °dONLNd∏uæÄL)our Own Device Driver” interpr;@°dONLNd÷uMÄ≤)èets a value of 100 as a r/°dONLNdÔu≤Ä)eequest for the ˇˇ/⁄.°dONLNd˛Ålå¿(âldevice driver to pr·Ó°dONLNdÅ¿åà)T+oduce a system beep. When the value of the ˇ˛_¥êò°dONLNd<Äâå≠)…csCodeˇˇ/⁄êò°dONLNdBÅ≠å∂)$ fi¿r°dONLNdEÅ∂å˜)    eld is 100, the °dONLNdUçlò®(ïl
  3848. value of the °dONLNdbå®ò“)<csParam°dONLNdiç“ò‹)* fi°dONLNdlç‹ò )
  3849.  
  3850. eld signifi°dONLNdwç òô)/es the number of times to beep.ˇˇ∂°dONLNdóül™Ä(ßlThe ˇ˛5lö∂°dONLNdõûÄ™Ê)MyGetDriverStatusˇˇ∂ö∂°dONLNd¨üÊ™Ú)f práðdONLNdØüÚ™) ocedurZ,°dONLNdµü™ù)!e also begins by setting up the fi&°dONLNd◊üû™¯)èelds of a parameter °dONLNdδl∂ü(≥l block. The °dONLNdˆ™ü∂’)3    ioCRefNum°dONLNdˇ´’∂fl)6 fi°dONLNd´fl∂)
  3851.  
  3852. eld specifi°dONLNd
  3853. ´∂s)0es the device driver rR`°dONLNd#´s∂Ö)defer$¿°dONLNd'´Ö∂Â)ence number and the °dONLNd;∂l¬¥(øl ioCompletion°dONLNdG∑¥¬ª)H fPİdONLNdI∑ª¬Ï) ield specif!°dONLNdT∑Ϭ¸)1ies !°dONLNdX∂¸¬)NIL¬†°dONLNd[∑
  3854. ¬l) for the completion rï°dONLNdp∑l¬£)_ outine. The ï°dONLNd|∂£¬«)7csCodeï°dONLNdÇ∑«¬Œ)$ feİdONLNdÑ∑Œ¬‰)ield .°dONLNdâ√lŒà(ÀlspecifiÓ °dONLNdê√àŒ8))es the type of status information being rŸ °dONLNdπ√8ŒÒ)∞+equested. For this particular device driver]`°dONLNd‰√ÒŒˆ)π, °dONLNdÊœl⁄%(◊l+the value 128 indicates the driver should r>†°dONLNdœ&⁄Ó)∫.eturn the number of times it last beeped. The ˇˇ1fi.°dONLNd?⁄lÊú(„lPBStatusˇˇòÔ°dONLNdG€úÊ2)0# function causes the driver to storÁ˙°dONLNdj€2Ê•)ñe this information in the ˇˇ1fi‰•°dONLNdÑ⁄¶Ê–)tcsParamˇˇòÔ‰•°dONLNd〖Ê÷)* fN°dONLNdç€◊ʯ)ield of .°dONLNdïÁlÚΔ(Ôlthe parameter block.
  3855. ˜*¯4¯*¯
  3856. #*+¯4$*+¯ $*$˛
  3857. ˇ·ˇ‚7^
  3858. ˇˇ£‰ˇÆ°dONLNd™*"+(*Reference to the Device Managerˇˇˇˇˇˇ⁄|(Ó1
  3859. °dONLNd 4l?(<l#This section describes the data strï`°dONLNdÌ4?)îuctur@°dONLNdÚ4?:)es and r‘°dONLNd˙4:?Ì)")outines that allow you to use the Device °dONLNd#@lK:(Hl,Manager to communicate with device drivers. °dONLNdPRl]®*
  3860. The “Data Strú °dONLNd]R®]ø)<uctur"°dONLNdbR¿]O) es” section shows the Pascal defi¿°dONLNdÉRP]◊)ênition for the Device Manager °dONLNd°^lia(fl7parameter block. The “Routines” section describes the re¿°dONLNdÿ^ai‡)ıoutines you use to open and °dONLNdÙjluÃ(rlclose device drivers, r]‡°dONLNd jÃuÂ)`ead fr‹ °dONLNdjÂuú))om and write to device drivers, and contr¯`°dONLNd:júu‡)∑ol and monitor °dONLNdIvlÅ!(~l)device drivers. Constants used by these r[`°dONLNdrv!ÅL)µ
  3861. outines ar¿°dONLNd|vMÅÍ),$e listed in the section “Summary of °dONLNd†Çlçƒ(älthe Device ManagerÅ`°dONLNd≤ǃç€)X,” on H@°dONLNd∏Ç‹ç¸)page 1-w°dONLNdøǸç) 37w°dONLNd¡Çç)
  3862. .°dONLNd√îlü±(úlThe chapter “W¿¿°dONLNd—î±üÀ)Eriting y`°dONLNdÿîÃü“)Y9‡°dONLNdŸî“ü‘)9our Own Device Driver” in this book describes the Device °dONLNd†l´∑(®lManager data strŒ °dONLNd"†∑´Œ)KucturT°dONLNd'†œ´Ò)es and r ¿°dONLNd/†Ú´≥)#+outines useful when writing a device driver߆°dONLNdZ†≤´¥)¿.
  3863. ÿ*‡¯4Ÿ*‡¯ Ÿ*Ÿ˛
  3864. ˇ·ˇ‚7^
  3865. ˇˇ◊ˇ◊°dONLNd\»*ÿb(‘*Data Strµ°dONLNdd»bÿÜ)8ucturôú°dONLNdi»áÿî)%esˇˇˇˇˇˇ•(‘1
  3866. °dONLNdlÂl‘(ÌlThe Device Manager prd@°dONLNdÅ‘ø)h7ovides both a high-level and a low-level interface for °dONLNd∏Òl¸(˘l#communicating with device drivers. ≥¿°dONLNd€Ò¸)¢Yt@°dONLNd‹Ò¸∫)&ou pass information to the low-level rdONLNdÒ∫¸Ô)¶
  3867. outines in a °dONLNd˝l(l Device Manager parameter block. °dONLNd0l”*OThe Device Manager uses two forms of the parameter block: one for the opening, °dONLNdl&î*
  3868. closing, rô°dONLNdâî&Ò)(eading, and writing r6†°dONLNdûÚ&s)^outines and another for contr4İdONLNdªs&÷)Åolling and monitoring °dONLNd—'l2o(/lrE°dONLNd“'p2˝)outines. Other managers use difV °dONLNdÒ'˝2    )çfer8†°dONLNdÙ'    2) ent variants of this data str&†°dONLNd'2ñ)vuctur¨Ä°dONLNd'ñ2ù)e.ˇÜ@ˇ ˇˇˇˇ@
  3869. ˇ·ˇ‚7^
  3870. 4H\, Palatino
  3871. .+ä"CHAPTER œ´)\1,     Helvetica
  3872.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  3873. ~¿(‡1
  3874. ‡)-a¿)15
  3875. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3876. 1/91(¯ä Second line.4^H¿,
  3877. Courier
  3878. .°dONLNd\Hhf(eHTYPE °dONLNdjTv¬+ =ParamBlkType = {ioParam, fileParam, volumeParam, cntrlParam};°dONLNdFxTÑ¥*ParamBlockRec = °dONLNdYÜfíä+RECORD°dONLNdcîx†ú+qLink:°dONLNdn)Z    QElemPtr;°dONLNd{î†Ü)H{next queue entry}°dONLNdë¢xÆú(´xqType:°dONLNdú¢“Æ)ZInteger;°dONLNd®¢Æb)H {queue type}°dONLNd∏∞xº¢(πxioTrap:°dONLNdƒ∞“º)ZInteger;°dONLNd–∞ºh)H
  3879. {routine trap°dONLNd·∞hºn)N}°dONLNdÊæx ¥(«x
  3880. ioCmdAddr:°dONLNdıæ“ Í)ZPtr;°dONLNd˝æ z)H{routine address°dONLNdæz Ä)`}°dONLNdÃxÿΔ(’x
  3881. ioCompletion:°dONLNd)Óÿ)ZProcPtr;°dONLNd5Ãÿí)H{completion routine}°dONLNdM⁄xÊÆ(„x    ioResult:°dONLNd[⁄“ʈ)ZOSErr;°dONLNde⁄Êh)H
  3882. {result code}°dONLNdvËxÙ¥(Òx
  3883. ioNamePtr:°dONLNdÖË“Ù)Z
  3884. StringPtr;°dONLNdìËÙb)H {driver name°dONLNd£ËbÙh)H}°dONLNd®ˆxÆ(ˇx    ioVRefNum°dONLNd≤ˆÆ¥)6:°dONLNd∑ˆ“)$Integer;°dONLNd√ˆÊ)H"{volume reference or drive number}°dONLNdÈx(
  3885. xCASE ParamBlkType OF°dONLNdä∫+ioParam:°dONLNd ä,“*   (ioRefNum:°dONLNd “,)H     Integer;°dONLNd- ,,º)Z{driver reference number°dONLNdM º,¬)ê}°dONLNdT.ú:ÿ(7ú
  3886. ioVersNum:°dONLNdb.‰:,)H  SignedByte;°dONLNds.>:t)Z    {not used°dONLNd.t:z)6}°dONLNdÜ<úHÿ(Eú
  3887. ioPermssn:°dONLNdî<‰H,)H  SignedByte;°dONLNd•<>H¬)Z{read/write permission°dONLNd¬<¬H»)Ñ}°dONLNd…JúVΔ(SúioMisc:°dONLNd‘J‰V)H Ptr;°dONLNdfiJ>Vz)Z
  3888. {not used}°dONLNdÓXúd“(aú    ioBuffer:°dONLNd˚X‰d)H Ptr;°dONLNdX>dŒ)Z{pointer to data buffer}°dONLNd#fúrfi(oú ioReqCount:°dONLNd2f‰r)H     LongInt;°dONLNd@f>r⁄)Z{requested number of bytes°dONLNdbf⁄r‡)ú}°dONLNditúÄfi(}ú ioActCount:°dONLNdxt‰Ä)H     LongInt;°dONLNdÜt>Ä»)Z{actual number of bytes°dONLNd§t»ÄŒ)ä}°dONLNd´Çúéÿ(ãú
  3889. ioPosMode:°dONLNdπljé)H     Integer;°dONLNd«Ç>é§)Z{positioning mode°dONLNd›Ç§é™)f}°dONLNd‰êúú‰(ôú ioPosOffset:°dONLNdÙê‰úÍ)H °dONLNdıêÍú )    LongInt);°dONLNdê>ú∞)T{positioning offset°dONLNdê∞ú∂)r}°dONLNd"ûä™Ã(ßä cntrlParam:°dONLNd2¨ä∏ÿ*
  3890.   (ioCRefNum:°dONLNdD¨‰∏)Z     Integer;°dONLNdR¨>∏Œ)Z{driver reference number°dONLNdr¨Œ∏‘)ê}°dONLNdy∫úΔΔ(√úcsCode:°dONLNdÑ∫‰Δ,)H  SignedByte;°dONLNdï∫>Δû)Z{type of request°dONLNd™∫ûΔ§)`}°dONLNd±»ú‘Ã(—úcsParam:°dONLNdΩ»‰‘Ä)H ARRAY[1..10] OF Integer);°dONLNdÓ÷>‚»+Z{control or status info°dONLNd÷»‚Œ)ä}°dONLNd ‰xê(ÌxEND;°dONLNdÚf˛~(˚fEND;
  3891. 
  3892. H4H
  3893.     .°dONLNdˇˇ+$Field descriptions
  3894. ˇ·ˇ‚7^
  3895. .°dONLNdä&®*qLink.°dONLNdÊ&ì)\%Used internally by the Device ManagerÎ`°dONLNdCí&ó)¨. .°dONLNdF)ä5®(2äqType.°dONLNdL*Ê5ì)\%Used internally by the Device ManagerÎ`°dONLNdq*í5î)¨..°dONLNds8äDÆ(AäioTrap.°dONLNdz9ÊDì)\%Used internally by the Device ManagerÎ`°dONLNdü9íDî)¨..°dONLNd°GäS¿(Pä    ioCmdAddr.°dONLNd´HÊSì)\%Used internally by the Device ManagerÎ`°dONLNd–HíSî)¨..°dONLNd“Väb“(_ä ioCompletion.°dONLNdflWÊb)\Specifi‡°dONLNdÊWbÉ)es a pointer to a completion rɇ°dONLNdWÑbÊ)Åoutine. When making °dONLNdcÊn(kÊasynchr$ °dONLNdc    n*)#onous ri†°dONLNd&c*n£)!equests, you must set this fiN†°dONLNdCc§n—)z
  3896. eld to NIL?°dONLNdMc—n¯)-
  3897.  if you arðdONLNdWc¯n)'e not °dONLNd]oÊzU(wÊspecifying a completion r1¿°dONLNdvoVz)p)outine. The Device Manager automatically .°dONLNdü{ÊÜ(ÉÊ sets this fi°dONLNd´{Ü5)1eld to °dONLNd≤z5ÜG)NIL!†°dONLNdµ{Gܺ) when you make a synchrÙ°dONLNdÃ{ªÜ⁄)tonous rΔ`°dONLNd”{⁄ܢ)equest.°dONLNd€âäï∫(íäioResult.°dONLNd‰äÊïù)\)Contains a value indicating whether the rî °dONLNd
  3898. äùïÏ)∑outine completed °dONLNdñʰ(ûÊ successfullyá`°dONLNd*ñ°®)4 . The Device Manager sets this fip`°dONLNdKñ©°)èeld to 1 when it queues °dONLNdc¢Ê≠(™Ê
  3899. an asynchruİdONLNdm¢≠7)0onous rª°dONLNdt¢7≠Á)!'equest. When the driver completes the rÍ °dONLNdõ¢Á≠)∞ equest, it °dONLNd¶ÆÊπ5(∂Êplaces the actual r•‡°dONLNdπÆ5πà)Oesult code in this fi© °dONLNdŒÆàπö)Seld. I@°dONLNd”Æõπ°)Y    ¿°dONLNd‘ưπÌ)ou can poll this fiV@°dONLNdÁÆÌπ)Leld to ˇp@ˇ ˇˇˇˇ@
  3900. ˇ·ˇ‚7^
  3901. 4*\˜, Palatino
  3902. .+l"CHAPTER œ´)\1,     Helvetica
  3903.     (@lThe Device Manager4⁄*˙¯
  3904. (‡*1 )-c)16
  3905.     )9Reference to the Device Manager
  3906. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3907. 1/91(¯l Second line.4^*¿¯
  3908. °dONLNd]»hÖ(e»*detect when the driver has completed the r‰`°dONLNd*]ÖhÚ)Ωequest and to determine °dONLNdBi»tÿ(q»its r,¿°dONLNdGiŸtŸ)8esult code. The Device Manager executes the completion rK†°dONLNdiŸt˜(qŸoutine °dONLNdÜu»Ä˜(}» after this fi`°dONLNdìu¯Ä )0eld r+ °dONLNdòu ÄB)
  3909. eceives the rf@°dONLNd•uBÄq)6 esult code.,
  3910. Courier.°dONLNd±Élè¢(ål    ioNamePtr.°dONLNdªÑ»èS)\ Points to the name of the driver °dONLNd€ÑSèX)ã. QİdONLNd›ÑXè^)Y°dONLNdfiÑ^èñ)
  3911. ou use this fib@°dONLNdÏÑñè◊)8eld only when °dONLNd˙ê»õ(ò»opening a driverw`°dONLNd
  3912. êõ)I..°dONLNd ûl™¢(ßl    ioVRefNum.°dONLNdü»™?)\Contains the drive number°dONLNd/ü?™])w, if any°dONLNd7ü\™¡). The meaning of this fi뇰dONLNdOü¡™—)eeld °dONLNdS´»∂I(≥»depends on the device driver…@°dONLNdo´H∂≈)Ä. The Disk Driver uses this fi °dONLNdç´Δ∂·)~eld to °dONLNdî∑»¬%(ø»identify disk devices.
  3913.     °dONLNd´œl⁄(◊lI/O fi‡°dONLNd±œÄ⁄≈)eld descriptions
  3914. .°dONLNd¬›lÈú(ÊlioRefNum.°dONLNdÀfi»ÈÂ)\Specifi‡°dONLNd“fiÂÈ")es the driver rs °dONLNd·fi#È3)>efer@°dONLNdÂfi4Èm) ence numberß °dONLNdfilÈn)8..°dONLNdÚÏl¯¢(ıl    ioVersNum.°dONLNd¸Ì»¯Û)\    Not used..°dONLNd˚l¢(l    ioPermssn.°dONLNd¸»)\Contains the rπ`°dONLNd¸†)>"ead/write permission of the driverR†°dONLNd@¸†ı)ö. When you open a °dONLNdR»„(»driver‡°dONLNdX„‘), you must supply one of the following values in this fiD¿°dONLNdꑉ)Òeld:.°dONLNdóÆ#( ÆCONST fsCurPerm °dONLNdß#)` °dONLNd®#8)= 0;  °dONLNdÆ8#⁄)${retain current permission}°dONLNd #Æ/¥(,Æ °dONLNdÀ#¥/∫) °dONLNdÃ#∫/¿) °dONLNdÕ#¿/Δ) °dONLNdŒ#Δ/Ã) °dONLNdœ#Ã/“) °dONLNd–#“/)
  3915. fsRdPerm  °dONLNd⁄#/)< °dONLNd€#/ )= °dONLNd›# /8) 1;  °dONLNd·#8/§){allow reads only}°dONLNdÙ/Æ;¥(8Æ °dONLNdı/¥;∫) °dONLNdˆ/∫;¿) °dONLNd˜/¿;Δ) °dONLNd¯/Δ;Ã) °dONLNd˘/Ã;“) °dONLNd˙/“;)    fsWrPerm °dONLNd/;)6 °dONLNd/;) °dONLNd/;2)= 2; °dONLNd
  3916. /2;8) °dONLNd /8;™){allow writes only}°dONLNd;ÆG¥(DÆ °dONLNd ;¥G∫) °dONLNd!;∫G¿) °dONLNd";¿GΔ) °dONLNd#;ΔGÃ) °dONLNd$;ÃG“) °dONLNd%;“G) fsRdWrPerm °dONLNd0;G8)B= 3;  °dONLNd6;8G»)${allow reads and writes}.°dONLNdPK»VG(S»The Device Manager compar°dONLNdiKHVå)Äes subsequent r9†°dONLNdxKåVœ)Dead and write rè °dONLNdáKœVÚ)Cequests °dONLNdèW»bÛ(_»
  3917. with the ruİdONLNdôWÛbç)+"ead/write permission of the driver¿°dONLNdªWçbØ)ö
  3918. . If the rcİdONLNd≈WØbÌ)"equest type is °dONLNd‘c»ni(k»#not permitted, the Device Manager rq‡°dONLNd˜cinö)° eturns a a rÀ°dONLNdcön…)1 esult code °dONLNdo»z(w»indicating the errò°dONLNd oz)LorB¿°dONLNd"oz)    ..°dONLNd$}lâê(ÜlioMisc.°dONLNd+~»âÛ)\    Not used..°dONLNd5ålòú(ïlioBuffer.°dONLNd>ç»ò&)\Points to the data buf‡†°dONLNdTç&ò°)^fer for the driver to use for r™°dONLNdsç¢ò‚)|eads or writes..°dONLNdÉõlß®(§l
  3919. ioReqCount.°dONLNdéú»ßÂ)\Specifi‡°dONLNdïúÂß)es the rô‡°dONLNdùúßΔ) ,equested number of bytes for the driver to rª °dONLNd…úΔ߉)¡ead or °dONLNd–®»≥·(∞»write..°dONLNd◊∂l¬®(øl
  3920. ioActCount.°dONLNd‚∑»¬ú)\1Indicates the actual number of bytes the driver r‡°dONLNd∑ù¬›)’eads or writes..°dONLNd#≈l—¢(Œl    ioPosMode.°dONLNd.Δ»—Â)\Specifi‡°dONLNd5Δ—˜)?es the positioning mode used by drivers of block devices. Bits °dONLNdt“»›(⁄»0 and 1 of this fi¸`°dONLNdÜ“›Z)Feld indicate wherª@°dONLNdó“[›ÿ)Me an operation should begin °dONLNd≥fi»ÈÀ(Ê»rE°dONLNd¥fiÃÈÌ)Aelative to the physical beginning of the block-formatted medium. °dONLNdıÍ»ıŒ(Ú»Y@İdONLNdˆÍŒı)Eou can use the following constants to test or set the value of these °dONLNd;ˆ»⁄(˛»bits:.°dONLNdC»"*CONST fsAtMark °dONLNdR".)Z  °dONLNdT.–)  = 0; {at current position}°dONLNdp»Œ(» °dONLNdqŒ‘) °dONLNdr‘⁄) °dONLNds⁄‡) °dONLNdt‡Ê) °dONLNduÊÏ) °dONLNdvÏ@)fsFromStart = °dONLNdÑ@R)T1; °dONLNdáR‹){offset from beginning}°dONLNdü»(Œ(%» °dONLNd†Œ(‘) °dONLNd°‘(⁄) °dONLNd¢⁄(‡) °dONLNd£‡(Ê) °dONLNd§Ê(Ï) °dONLNd•Ï(4) fsFromMark  °dONLNd±4(R)H= 2; °dONLNd∂R(Ó){offset from current pos.}.°dONLNd“,»7Í(4»The Disû`°dONLNdŸ,Í7Ê)":k Driver allows you to add the following constant to this °dONLNd8»CŒ(@»fiå¿°dONLNd8ŒC)eld to specify a r¿°dONLNd'8Ct)Iead-verify operation:.°dONLNd?F»R"(O»CONST rdVerify °dONLNdNF"R.)Z  °dONLNdPF.Ræ) = 64; {read-verify mode}ˇˇÏ‡°dONLNdqV»aB(^»See the description of the ˇˇŸ¿ `°dONLNdåUCag){PBReadˇˇÏ‡ `°dONLNdíVga‘)$ function in “Reading Fr¶@°dONLNd™V‘a˜)mom and .°dONLNd±b»m“(j»W¬†°dONLNd≤b—mÚ)    riting Tfi†°dONLNd∫bÒm3) o Devices,” on '`°dONLNd…b4mT)Cpage 1-V °dONLNd–bTm^) 25V °dONLNd“b^m`)
  3921. ..°dONLNd‘pl|Æ(yl ioPosOffset.°dONLNd‡q»|Â)\Specifi‡°dONLNdÁqÂ|)es the byte of`°dONLNdıq |8);fset, ru@°dONLNd¸q8|∂)elative to the position specifi”‡°dONLNdq∂|·)~
  3922. ed by the °dONLNd%}»à1(Ö»positioning mode, wher=`°dONLNd;}2àÔ)j+e the driver should perform the operation. ˇ˛≥3.°dONLNdfâ»î(ë»If you specify the ˇ˝ffLðdONLNdyàîH)PfsAtMarkˇ˛≥3LðdONLNdÅâHî¯)0& positioning mode, the Device Manager .°dONLNdßﻆfl(ù»ignor`°dONLNd¨ï‡†)    es this fiO‡°dONLNd∂ï†)$eld.ˇÜ@ˇ ˇˇˇˇ@
  3923. ˇ·ˇ‚7^
  3924. 4H\, Palatino
  3925. .+ä"CHAPTER œ´)\1,     Helvetica
  3926.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  3927. ~¿(‡1
  3928. ‡)-a¿)17
  3929. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3930. 1/91(¯ä Second line.4^H¿
  3931.     °dONLNd\äg·(däControl and status fi˙–°dONLNd\·g&)Weld descriptions,
  3932. Courier
  3933. .°dONLNd&jäv¿(sä    ioCRefNum.°dONLNd0kÊvB)\Contains the driver r톰dONLNdEkBvR)\efer>¿°dONLNdIkSvå) ence numberΔ†°dONLNdTkãvç)8..°dONLNdVyäÖÆ(ÇäcsCode.°dONLNd]zÊÖæ)\2Contains a value identifying the type of the contrL°dONLNdèzøÖÚ)Ÿ
  3934. ol or status °dONLNdúÜÊëÈ(éÊrE°dONLNdùÜÍëu)equest. Each driver may interpr °dONLNdºÜvë≈)ået this number difÒ°dONLNdŒÜƒë–)Nfer”İdONLNd—Ü–ëÊ) ently †°dONLNd÷ÜÊëË)..°dONLNdÿî䆥(ùäcsParam.°dONLNd‡ïʆT)\Contains the actual contr’°dONLNd˘ïT†‚)n"ol or status information for the r∫†°dONLNd)éequest; °dONLNd#°Ê¨˛(©Êthis fiE‡°dONLNd*°ˇ¨4)
  3935. eld is declar<°dONLNd7°4¨)53ed generically as an array of ten integers because °dONLNdj≠Ê∏T(µÊits actual format varies fr˝°dONLNdÖ≠T∏Ø)nom one type of contr| °dONLNdô≠∞∏Á)\ol or status rç°dONLNdß≠Á∏)7
  3936. equest to °dONLNd±πʃ (¡Ê    the next.
  3937. ÒH˘4ÚH˘ ÚHÚ
  3938. ˇ·ˇ‚7^
  3939. ˇˇ◊ˇ◊°dONLNdª·HÒÖ(ÌHRoutinesˇˇˇˇˇˇ•(Ì1
  3940. °dONLNdƒ˛ä    K(ä+This section describes the Device Manager rˇ†°dONLNdÔ˛K    )¡)outines you use to open and close device °dONLNd
  3941. ä≤(ä
  3942. drivers, r€@°dONLNd"
  3943. ≤À)(ead frYİdONLNd(
  3944. ÃÉ))om and write to device drivers, and contru¿°dONLNdQ
  3945. É )∑ol and monitor device drivers. °dONLNdqä'Ã($äThe low-level r¿°dONLNdÄÕ'Ë)CCoutines in this section accept a pointer to a parameter block as a °dONLNd√(ä3∑(0ä    parameterS†°dONLNdÃ(∑3Í)-
  3946. . For these rÛ‡°dONLNdŸ(Í3#)3outines, the rdONLNdÁ($3◊):+outine description includes a list of the fix‡°dONLNd(ÿ3)¥ elds in the °dONLNd4ä?Ò(<äparameter block that arë°dONLNd64Ò?1)ge used by the r=@°dONLNdE42?P)Aoutine.
  3947. cHk4dHk dHd
  3948. ˇ·ˇ‚7^
  3949. °dONLNdMVHc (`H"Opening and Closing Device Driversˇˇˇˇˇˇ(`1
  3950. °dONLNdpläwë(täA∫†°dONLNdqlëw) driver must be open befor1‡°dONLNdãlwÃ)v,e your application can communicate with it. 
  3951. İdONLNd∑lÃw“)≈YŒ°dONLNd∏l—w)ou can use the .°dONLNd«wäÉΔ(Ää
  3952. OpenDriver°dONLNd—xΔÉ’)< or °dONLNd’w’ɢ)PBOpen°dONLNd€x˘É)$< function to open closed drivers or to determine the driver ˇˇœÎ°dONLNdÑäèé(åärR`°dONLNdÑéè†)efer$¿°dONLNdцè)ence number of an alr6ðdONLNd1Ñèo)`eady open device driverÈ-°dONLNdHÑnès)n. ãx°dONLNdJÑtè{)Y†x°dONLNdKÑzèº)ou can use the ˇˇü÷‡$°dONLNdZɺèÏ)BOpenSlotˇˇœÎ‡$°dONLNdbÑÏè)0
  3953.  function .°dONLNdlêäõ3(òä(to open drivers that serve slot devices.°dONLNdï¢ä≠ÿ*When you have fiΔ °dONLNd•¢ÿ≠y)N"nished communicating with a driver¨¿°dONLNd«¢y≠È)°, you can close it if you ar†°dONLNd„¢Í≠ˇ)qe surY`°dONLNdË¢ˇ≠)e no ˇˇ.ü.°dONLNdÌÆäπÅ(∂ä9other application or part of the system needs to use it. S5°dONLNd&ÆÅπà)˜Yh5°dONLNd'ÆáπΔ)ou can use the ˇ˛]>"±°dONLNd6≠«π    )@ CloseDriverˇˇ.ü"±°dONLNdAÆ    π)B or °dONLNdEπä≈¥(¬äPBClose°dONLNdL∫¥≈))* function to close a driver¬†°dONLNdg∫(≈+)t.°dONLNdiÃä◊ü(‘äThe °dONLNdmÀü◊√)PBOpen°dONLNdsÃ√◊⁄)$ and °dONLNdxÀ⁄◊)PBClose°dONLNdÃ◊q)* functions use the I/O fi°dONLNdòÃq◊ )m!elds of the parameter block. The ˇ˝∏°dONLNdπ◊ä„∫(‡äOpenSlotˇ˛é‹°dONLNd¡ÿ∫„)0 function uses the I/O fðdONLNdŸÿ„ó)cields and some additional f&º°dONLNdÙÿó„)zields that apply only to slot .°dONLNd‰äÔ≠(Ïädevices.
  3954. H'4 H'  H 
  3955. ˇ·ˇ‚7^
  3956. °dONLNdHä(H
  3957. OpenDriverˇˇˇˇˇˇ(1
  3958. ˇˇ>∞.°dONLNd'2ä=ë(:äYï°dONLNd(2ê=œ)ou can use the ˇ˛}`è¿°dONLNd71–= )@
  3959. OpenDriverˇˇ>∞è¿°dONLNdA2 =)<= function to open a closed device driver or to determine the .°dONLNd~>äIç(FärE°dONLNd>éIû)eferÒ °dONLNdÉ>ûIE)$ence number of an open device driver≠İdONLNdß>EIG)ß..°dONLNd©Uäa(^äFUNCTION OpenDriver °dONLNdΔUaV)x(name: Str255;°dONLNdficˆo∞(lˆ   VAR refNum: Integer): OSErr;°dONLNd˛{äá¢(Ñäname.°dONLNd|ÃáÈ)BSpecifi‡°dONLNd
  3960. |Èá)#es the name of the driver to open. 0°dONLNd-|Äáá)óAj†°dONLNd.|áá˙) driver name consists of a °dONLNdIàÃì(êÃIperiod (.) followed by any sequence of 1 to 254 printing characters. The °dONLNdíîÃü.* Device Manager ignor‰¿°dONLNd¶î.ü)b3es case (but not diacritical marks) when comparing °dONLNdŸ†Ã´Î(®Ãnames.ˇ‡@ˇ ˇˇˇˇ@
  3961. ˇ·ˇ‚7^
  3962. 4*\˜, Palatino
  3963. .+l"CHAPTER œ´)\1,     Helvetica
  3964.     (@lThe Device Manager4⁄*˙¯
  3965. (‡*1 )-c)18
  3966.     )9Reference to the Device Manager
  3967. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  3968. 1/91(¯l Second line.4^*¿¯,
  3969. Courier
  3970. .°dONLNd\lhê(elrefNum°dONLNd]Æh)BContains the rR`°dONLNd]h)Befer$¿°dONLNd]hw)ence number of the driverg`°dONLNd2]vhë)t. The g`°dONLNd8\ëhÕ)
  3971. OpenDriverg`°dONLNdB]Õh˜)<
  3972.  function .°dONLNdLiÆt(qÆuses this parameter to r¿°dONLNdditD)h eturn the rã@°dONLNdoiDtT).efer7`°dONLNdsiUt‡)ence number of the open driver—‡°dONLNdëiflt·)ä.
  3973. °dONLNdìè*óc(ï* DESCRIPTION
  3974. ˇˇU.°dONLNdüûl©Ä+BThe ˇ˛*™ïU°dONLNd£ùÄ©º)
  3975. OpenDriverˇˇUïU°dONLNd≠ûº©n)<( function opens the device driver specifiS°dONLNd÷ûo©õ)≥
  3976. ed by the ˇ˛*™UR°dONLNd‡ùõ©≥),nameˇˇUUR°dONLNd‰û≥©˙) parameter and ˇˇ    ¶°dONLNdÛ™lµp(≤lrR`°dONLNdÙ™pµü) eturns its r8 °dONLNd™üµ±)/efer
  3977. l°dONLNd™±µ)ence number in the ˇ˛L1°dONLNd©µ))TrefNumˇˇ    ¶1°dONLNd™)µ[)$
  3978.  parameter}J°dONLNd'™Zµ“)1. The Device Manager searvB°dONLNd@™“µ˙)x    ches the .°dONLNdI∂l¡™(ældrivers that ar1`°dONLNdX∂´¡æ)?e alr(`°dONLNd]∂æ¡])&eady installed in the unit table beforÇ °dONLNdÉ∂]¡v)üe searó`°dONLNdâ∂v¡≤)ching driver r@ °dONLNdó∂≥¡À)=esourà`°dONLNdú∂À¡Ê)ces to °dONLNd£¬lÕã( lavoid r‰‡°dONLNd™¬ãÕÃ)eplacing a currÅ °dONLNdπ¬ÕÕ¯)B
  3979. ent driverz`°dONLNd√¬¯Õ2)+. If the specifix@°dONLNd”¬3Õs);ed driver is alr    †°dONLNd„¬tÕ·)Aeady open, this function °dONLNd¸ŒlŸê(÷lsimply r8°dONLNdŒëŸ€)%eturns the driver@ °dONLNdŒ‹ŸÈ)K’s râ`°dONLNdŒÈŸ˘)
  3980. efer5İdONLNdŒ˙Ÿ3) ence numberΩ`°dONLNd(Œ2Ÿ7)8. °dONLNd+‡lΰ(Ël
  3981. If the specifi}‡°dONLNd9‡¢ÎÛ)6ed driver is not alrİdONLNdM‡ÙÎî)R"eady open, the Device Manager sear*°dONLNdo‡îÎfi)†ches for a driver °dONLNdÅÏl˜o(ÙlrE°dONLNdÇÏp˜à)esourç@°dONLNdáÏà˜◊)ce with the specifi¿°dONLNdöÏ◊˜l)O ed name. If the Device Manager fi8°dONLNdªÏm˜¢)ñ nds such a r,‡°dONLNd«Ï¢˜∫)5esouru °dONLNdÃÏ∫˜ÿ)ce, the °dONLNd‘¯lo(lrE°dONLNd’¯pà)esourç@°dONLNd⁄¯àj)4ce ID determines the location in the unit table wher≈¿°dONLNd¯jÓ)‚e the Device Manager installs °dONLNd,ló( l
  3982. the driverÙ°dONLNd6ò@),&’s DCE. Since another driver might alr`°dONLNd\AÒ)©+eady be installed in the unit table at the °dONLNdálÈ(llocation determined by the r–°dONLNd£È)}esour@°dONLNd®X)ce ID, you should fiïİdONLNdºXw)Vrst searS °dONLNdƒxı) ch for an unused location in °dONLNd·l'¿($lthe unit table and ré¿°dONLNdı¿'˛)T
  3983. enumber the rΠ°dONLNd˛')>esour3`°dONLNd':)ce accor@°dONLNd:'p)# dingly beforD°dONLNdp'Â)6e calling this function. See °dONLNd8(l3À(0lListing 1-1 on page 1-dONLNdN(À3–)_8dONLNdO(–3) for an example.ˇ˛ˇ˛.°dONLNd`7lB(?lThe ˇ˝ˇ¸˛°dONLNdd6ÄBº)
  3984. OpenDriverˇ˛ˇ˛˛°dONLNdn7ºBó)<3 function is a high-level version of the low-level ˇ˝ˇ¸ϰdONLNd°6òBº)‹PBOpenˇ˛ˇ˛ϰdONLNdß7ºB˘)$ function. Use ˇˇ%√°dONLNd∂ClN~(Klthe ˇ˛KÜ•√°dONLNd∫B~N¢)PBOpenˇˇ%√•√°dONLNd¿C¢NA)$$ function when you need to specify rÄx°dONLNd‰CAN„)ü#ead/write permission for the driverZ$°dONLNdC„N˙)¢. See °dONLNd
  3985. OlZ‘(Wlthe description of the °dONLNd$N‘Z¯)hPBOpen°dONLNd*O¯Z/)$
  3986.  function on ,Times°dONLNd7N/ZL)7page 1-°dONLNd>NLZV)18°dONLNd@OVZY)
  3987. .
  3988. .°dONLNdBu*}L({*SPECIALU°dONLNdIuM}Å)#
  3989.  CONSIDERAÁ°dONLNdSuÄ}ö)3TIONS
  3990. ˇˇ⁄&.°dONLNdYÑlèÄ(ålThe ˇˇ¥LZ&°dONLNd]ÉÅèΩ)
  3991. OpenDriverˇˇ⁄&Z&°dONLNdgÑΩèŒ)<; function may move memory; you should not call it at interr•»°dONLNd¢ÑŒè˜(匠   upt time.
  3992. .°dONLNd¨™*≤D(∞*RESULèU°dONLNd±™D≤h)T CODES
  3993. .°dONLNdπ∏lƒä+(noErr.°dONLNdøπ¯ƒ˝)å0°dONLNd¡πƒ-)No errE†°dONLNd«π.ƒ7)or.°dONLNd √lœ®(Ãl
  3994. badUnitErr.°dONLNd’ƒÓœ˝)Ç–21°dONLNdŸƒœ()#Refer⁄ °dONLNdfiƒ(œ”)&ence number out of range or not in use.°dONLNdŒl⁄¥(◊l unitEmptyErr.°dONLNdœÓ⁄˝)Ç–22°dONLNdœ⁄Å)#DCE points to null driver.°dONLNd0ŸlÂñ(‚lopenErr.°dONLNd8⁄Ó½)Ç–23°dONLNd<⁄Âs)#Driver can’t perform rY`°dONLNdR⁄sÂ≥)b
  3995. equested open.°dONLNd`‰lú(ÌldInstErr.°dONLNdiÂÓ˝)Ç–26°dONLNdmÂ@)#
  3996. Couldn’t fiİdONLNdxÂA|)0nd driver in rƒ†°dONLNdÜÂ|î);esour ‡°dONLNdãÂï¶)ce fi”İdONLNdê¶≠)le
  3997. °dONLNdì
  3998. *Q(*SEE ALSO
  3999. °dONLNdúl$+B%For information about the low-level rƆ°dONLNd¡$È)§3outines for opening devices, see the next section, ˇˇbt.°dONLNdÙ%l0 (-lwhich describes the ˇ˛ƒËß\°dONLNd$ 0Ó)^PBOpenˇˇbtß\°dONLNd%Ó0í)$& function, and the description of the ˇ˛ƒËXà°dONLNd4$ì0√)•OpenSlotˇˇbtXà°dONLNd<%√0¯)0
  4000.  function on .°dONLNdI1l<å(9lpage 1-Æ¿°dONLNdP1å<ñ) 20Æ¿°dONLNdR1ñ<ò)
  4001. .°dONLNdTClN&(Kl)For an example of opening a device driver±†°dONLNd}C&N;)∫, see ‡°dONLNdÉC<Nõ)Listing 1-1 on page 1-¿°dONLNdôCõN†)_8¿°dONLNdöC†N¢).
  4002. ~*ܯ4*ܯ *˛
  4003. ˇ·ˇ‚7^
  4004. °dONLNdùq*~W({*PBOpenˇˇˇˇˇˇ({Ú1
  4005. .°dONLNd§ëlús(ôlYï°dONLNd•ërúµ)ou can use the ï°dONLNd¥êµúŸ)CPBOpenï°dONLNd∫ëŸúÏ)$= function to open a closed device driver or to determine the .°dONLNd˜ùl®o(•lrE°dONLNd¯ùp®Ä)eferÒ °dONLNd¸ùÄ®')$ence number of an open device driver≠İdONLNd ù'®))ß.ˇ®@ˇ ˇˇˇˇ@
  4006. ˇ·ˇ‚7^
  4007. 4H\, Palatino
  4008. .+ä"CHAPTER œ´)\1,     Helvetica
  4009.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4010. ~¿(‡1
  4011. ‡)-a¿)19
  4012. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4013. 1/91(¯ä Second line.4^H¿,
  4014. Courier
  4015. .°dONLNd\äh‰(eäFUNCTION PBOpen°dONLNd\‰hÍ)Z °dONLNd\Íhz)(paramBlock: ParmBlkPtr;°dONLNd9j‰vÍ(s‰ °dONLNd:jÍv) °dONLNd;jvz)async: Boolean): OSErr;°dONLNdSÇäéΔ(ãä
  4016. paramBlock.°dONLNd^ÉÃéÜ)B*Contains a pointer to the parameter block..°dONLNdâíäû®(õäasync.°dONLNdèìÃûÈ)BSpecifi‡°dONLNdñìÈûñ)&es to the Device Manager whether the rRİdONLNdºìóûΩ)Æ    equest is.°dONLNd«üÙ(ßÃasynchrR`°dONLNdŒü™)$onous. $¿°dONLNd’ü™)Y9¿°dONLNd÷ü™ï)ou should always set this fi9¿°dONLNdÚüï™≥)Åeld to 9¿°dONLNd˘û≥™—)FALSE9¿°dONLNd˛ü—™‘)..°dONLNd±äºê(πäY@İdONLNd±êºˆ)ou specify values and rP°dONLNd±ˆº)feceive r¿°dONLNd ±º¯)!1eturn values in a Device Manager parameter block.
  4017. …HŸ4 Hÿ
  4018.     °dONLNdˇˇ(—äParameter block
  4019. ˇ·ˇ‚7^,    Symbol
  4020. °dONLNdˇˇ*Æ.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8A∫†°dONLNdˇˇ) pointer to completion rG°dONLNdˇˇ)ioutine.°dONLNdˇˇ(Îä¨.°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8The rÄ¿°dONLNdˇˇ)esult code of the function.°dONLNdˇˇ(˜äÆ.°dONLNdˇˇ)    ioNamePtr°dONLNdˇˇ)Q    StringPtr.°dONLNdˇˇ+8 A∫†°dONLNdˇˇ) pointer to the driver name.°dONLNdˇˇ(ä¨.°dONLNdˇˇ)ioRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8 The driver rZ°dONLNdˇˇ)5efer °dONLNdˇˇ) ence numberé°dONLNdˇˇ)8.°dONLNdˇˇ(äÆ.°dONLNdˇˇ)    ioPermssn°dONLNdˇˇ)Q    SignedByt°dONLNdˇˇ)6e.°dONLNdˇˇ+ Read/write permission.
  4021. °dONLNdêRHZÅ(XH DESCRIPTION
  4022. .°dONLNdú`äkü+BThe °dONLNd†_ük√)PBOpen°dONLNd¶`√k{)$( function opens the device driver specifi°dONLNdœ`{k™)∏
  4023. ed by the °dONLNdŸ_™k‡)/    ioNamePtr°dONLNd‚`‡kÍ)6 fi°dONLNdÂ`Íkˇ)
  4024. eld, ˇˇ˘y°dONLNdÍläw˙(täinstalling it if necessaryP´°dONLNdl˙w)p, and r˝°dONLNd lwH) eturns its r€O°dONLNdlHwZ)0efer≠ذdONLNdlZw±)ence number in the ˇˇÚÚìì°dONLNd.k≤w‚)XioRefNumˇˇ˘yìì°dONLNd6l‚wÎ)0 fiç °dONLNd9lÏw)
  4025.     eld. The .°dONLNdBxäÉÊ(ÄäDevice Manager sear-°dONLNdUxÁÉL)]ches the drivers that ar°dONLNdmxLÉ_)ee alr˚°dONLNdrx^É˝)&eady installed in the unit table beforT¿°dONLNdòx˛É)†e °dONLNdöÑäèõ(åäsearK†°dONLNdûÑúèÿ)ching driver rÙ`°dONLNd¨Ñÿè)<esour<†°dONLNd±ÑÒè+)ces to avoid r–@°dONLNdøÑ+èl):eplacing a currlİdONLNdŒÑmèò)B
  4026. ent drivere¿°dONLNdÿÑòè“)+. If the specific†°dONLNdËÑ”è);
  4027. ed driver is °dONLNdıêäõï(òäalr-`°dONLNd¯êñõ) eady open, this function r@‡°dONLNdêõW)qeturns the driver r–†°dONLNd%êWõg)Pefer|¿°dONLNd)êhõØ)ence number alrÔ`°dONLNd8êØõ)Geady belonging to the °dONLNdNúäß•(§ädriver‡°dONLNdTú•ßß).°dONLNdVÆäπø(∂ä
  4028. If the specifi}‡°dONLNddÆ¿π)6ed driver is not alrİdONLNdxÆπ≤)R"eady open, the Device Manager sear*°dONLNdöÆ≤π¸)†ches for a driver °dONLNd¨∫ä≈ç(¬ärE°dONLNd≠∫é≈¶)esourç@°dONLNd≤∫¶≈ı)ce with the specifi¿°dONLNd≈∫ı≈ä)O ed name. If the Device Manager fi8°dONLNdÊ∫ã≈¿)ñ nds such a r,‡°dONLNdÚ∫¿≈ÿ)5esouru °dONLNd˜∫ÿ≈ˆ)ce, the °dONLNdˇΔä—ç(ŒärE°dONLNdΔé—¶)esourç@°dONLNdΔ¶—à)4ce ID determines the location in the unit table wher≈¿°dONLNd9Δà— )‚e the Device Manager installs °dONLNdW“䛵(⁄ä
  4029. the driverÙ°dONLNda“∂›^),&’s DCE. Since another driver might alr`°dONLNdá“_›)©+eady be installed in the unit table at the °dONLNd≤fiäÈ(Êälocation determined by the r–°dONLNdŒfiÈ)}esour@°dONLNd”fi Èv)ce ID, you should fiïİdONLNdÁfivÈï)Vrst searS °dONLNdÔfiñÈ) ch for an unused location in °dONLNd Íäıfi(Úäthe unit table and ré¿°dONLNd Ífiı)T
  4030. enumber the rΠ°dONLNd-Íı4)>esour3`°dONLNd2Í5ıX)ce accor@°dONLNd:ÍXıé)# dingly beforD°dONLNdFÍéı)6e calling this function. See °dONLNdcˆäÈ(˛äListing 1-1 on page 1-dONLNdyˆÈÓ)_8dONLNdzˆÓ5) for an example.°dONLNdãä≈(
  4031. äIf the driver rưdONLNdö≈);eturns a negative rÀ‡°dONLNd≠=)R
  4032. esult in rÉ °dONLNd∑>Œ)' egister D0, the Device Manager r@‡°dONLNd◊œ˝)ë eturns the .°dONLNd‚äé(ärR`°dONLNd„é›)esult code in the R`°dONLNdı›
  4033. )OioResultR`°dONLNd˝
  4034. «)0' parameter and does not open the driverï°dONLNd$Δ…)π.
  4035. .°dONLNd&8H@j(>HSPECIALU°dONLNd-8k@ü)#
  4036.  CONSIDERAÁ°dONLNd78û@∏)3TIONS
  4037. .°dONLNd=FäQü(NäThe °dONLNdAEüQ√)PBOpen°dONLNdGF√Q÷)$; function may move memory; you should not call it at interrl°dONLNdÇF÷Q(N÷    upt time.
  4038. .°dONLNdåmHun(sHASSEMBL‹è°dONLNdìmnur)&Yö∫°dONLNdîmsu–)-LANGUAGE INFORMA—U°dONLNd•m–uÂ)]TION
  4039. ˇˇÎ·.°dONLNd™{äÜÀ(Éä
  4040. The trap macr*"°dONLNd∑{Ã܈)B
  4041. o for the ˇˇ◊¬Ì≈°dONLNd¡zˆÜ)*PBOpenˇˇÎ·Ì≈°dONLNd«{ÜN)$
  4042.  function is ˇˇ◊¬±h°dONLNd‘zOÜm)5_OpenˇˇÎ·±h°dONLNdŸ{mÜö)
  4043.  ($A000). [ä°dONLNd„{õÜ¢).Ypä°dONLNd‰{°Ü‰)ou must setup rç°dONLNdÛ{ÂÜ)Degister î°dONLNd˚{Ü)!A0 ˇˇ°dONLNd˛áäíÀ(èä
  4044. with the addrä~°dONLNd áÀíd)A!ess of the parameter block. When ˇ˛82ÿ°dONLNd,ÜeíÉ)ö_Openˇˇ2ÿ°dONLNd1áÉíâ) r!G°dONLNd3áâí≠)    eturns, r∂°dONLNd<á≠í)$egister D0 contains the .°dONLNdTìäûç(õärE°dONLNdUìéû))%esult code. Register D0 is the only r∂¿°dONLNdzì)ûQ)õ
  4045. egister afŸ¿°dONLNdÑìQûí)(fected by this r$ °dONLNdîììû±)Boutine.
  4046.     °dONLNdú¢ä≠ÿ(™äRegisters on entry
  4047. °dONLNdرäºñ*A0°dONLNd≤±Δº€)<addr|İdONLNd∂±€ºN)ess of the parameter blockˇÙ@ˇ ˇˇˇˇ@
  4048. ˇ·ˇ‚7^
  4049. 4*\˜, Palatino
  4050. .+l"CHAPTER œ´)\1,     Helvetica
  4051.     (@lThe Device Manager4⁄*˙¯
  4052. (‡*1 )-c)20
  4053.     )9Reference to the Device Manager
  4054. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4055. 1/91(¯l Second line.4^*¿¯
  4056.     °dONLNd\lg¥(dlRegisters on exit
  4057. °dONLNdklvx*D0°dONLNdk®v´)<rE°dONLNdk¨vÿ)
  4058. esult code
  4059. °dONLNd!ë*ôD(ó*RESULèU°dONLNd&ëDôh)T CODES,
  4060. Courier
  4061. .°dONLNd.ül´ä+(noErr.°dONLNd4†¯´˝)å0°dONLNd6†´-)No errE†°dONLNd<†.´7)or.°dONLNd?™l∂®(≥l
  4062. badUnitErr.°dONLNdJ´Ó∂˝)Ç–21°dONLNdN´∂()#Refer⁄ °dONLNdS´(∂”)&ence number out of range or not in use.°dONLNdzµl¡¥(æl unitEmptyErr.°dONLNdá∂Ó¡˝)Ç–22°dONLNdã∂¡Å)#DCE points to null driver.°dONLNd•¿lÃñ(…lopenErr.°dONLNd≠¡ÓÃ˝)Ç–23°dONLNd±¡Ãs)#Driver can’t perform rY`°dONLNd«¡sÃ≥)b
  4063. equested open.°dONLNd’Àl◊ú(‘ldInstErr.°dONLNdfiÃÓ◊˝)Ç–26°dONLNd‚Ã◊@)#
  4064. Couldn’t fiİdONLNdÌÃA◊|)0nd driver in rƒ†°dONLNd˚Ã|◊î);esour ‡°dONLNdÃï◊¶)ce fi”İdONLNdö◊≠)le
  4065. °dONLNdÒ*˘Q(˜*SEE ALSO
  4066. °dONLNdl +B&For information about the high-level r°dONLNd7 ◊)®-outine for opening device drivers, see the pr&¿°dONLNdd◊ ˆ)√evious .°dONLNdk l˝(l section, which describes of the °dONLNdã ˝9)ë
  4067. OpenDriver°dONLNdï 9@)< rR`°dONLNdó @_)outine..°dONLNdül)(&l%For information about the low-level rƆ°dONLNdƒ)˜)§5outine for opening device drivers that serve devices .°dONLNd˘*l5∑(2lon expansion carR`°dONLNd    *∑5í)K1ds, see the next section, which describes of the R`°dONLNd:)í5¬)€OpenSlotR`°dONLNdB*¬5…)0 r$¿°dONLNdD*…5Ë)outine..°dONLNdL<lG&(Dl)For an example of opening a device driver±†°dONLNdu<&G;)∫, see ‡°dONLNd{<<Gõ)Listing 1-1 on page 1-¿°dONLNdë<õG†)_8¿°dONLNdí<†G¢).
  4068. w*¯4x*¯ x*x˛
  4069. ˇ·ˇ‚7^
  4070. °dONLNdïj*w^(t*OpenSlotˇˇˇˇˇˇ(tÚ1
  4071. .°dONLNdûälïs(ílYï°dONLNdüärïµ)ou can use the ï°dONLNdÆâµïÂ)COpenSlotï°dONLNd∂äÂïÚ)0< function to open a device driver that serves a slot device.°dONLNdÛ°l≠“(™lFUNCTION OpenSlot°dONLNd °“≠b)f(paramBlock: ParmBlkPtr;°dONLNd-ØΔªÃ(∏Δ °dONLNd.ØÃª“) °dONLNd/Ø“ªÿ) °dONLNd0Øÿªh)async: Boolean) : OSErr;°dONLNdI«l”®(–l
  4072. paramBlock.°dONLNdT»Æ”h)B*Contains a pointer to the parameter block..°dONLNd◊l„ä(‡lasync.°dONLNdÖÿÆ„À)BSpecifi‡°dONLNdåÿÀ„x)&es to the Device Manager whether the rRİdONLNd≤ÿy„ü)Æ    equest is.°dONLNdΩ‰ÆÔ“(ÏÆasynchrR`°dONLNdƒ‰“Ô)$onous. $¿°dONLNdÀ‰Ô˜)Y9¿°dONLNdɈÔw)ou should always set this fi9¿°dONLNdˉwÔï)Åeld to 9¿°dONLNdÔ„ïÔ≥)FALSE9¿°dONLNdÙ‰≥Ô∂)..°dONLNdˆˆlr(˛lY@İdONLNd˜ˆrÿ)ou specify values and rP°dONLNdˆÿ˘)feceive r¿°dONLNdˆ˘Ò)!6eturn values in a Device Manager parameter block with °dONLNdLl
  4073. º(
  4074. la few additional fi˚ °dONLNd_º
  4075. W)P%elds that apply only to slot devices.
  4076. **¯4*)¯
  4077.     °dONLNdˇˇ("lParameter block
  4078. ˇ·ˇ‚7^,    Symbol
  4079. °dONLNdˇˇ*Æ.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8Pointer to completion r쇰dONLNdˇˇ)foutine.°dONLNdˇˇ(<l¨.°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8 Result code.°dONLNdˇˇ(HlÆ.°dONLNdˇˇ)    ioNamePtr°dONLNdˇˇ)Q    StringPtr.°dONLNdˇˇ+8 Driver name.°dONLNdˇˇ(`l¨.°dONLNdˇˇ)ioRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Driver rø¿°dONLNdˇˇ)#eferk‡°dONLNdˇˇ) ence numberÛ¿°dONLNdˇˇ)8.°dONLNdˇˇ(llÆ.°dONLNdˇˇ)    ioPermssn°dONLNdˇˇ)Q    SignedByt°dONLNdˇˇ)6e.°dONLNdˇˇ+ Read/write permission.ˇ\@ˇ ˇˇˇˇ@
  4080. ˇ·ˇ‚7^
  4081. 4H\, Palatino
  4082. .+ä"CHAPTER œ´)\1,     Helvetica
  4083.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4084. ~¿(‡1
  4085. ‡)-a¿)21
  4086. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4087. 1/91(¯ä Second line.4^H¿
  4088.     °dONLNdˇˇ(dä Additional fi|0°dONLNdˇˇ)4elds—single device,    Symbol
  4089. °dONLNdˇˇ(säÆ,
  4090. Courier.°dONLNdˇˇ)ioMix°dONLNdˇˇ)QPtr.°dONLNdˇˇ)8!Reserved for use by driver Open rÙ@°dONLNdˇˇ)ñoutine.°dONLNdˇˇ(äÆ.°dONLNdˇˇ)ioFlags°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8!Determines number of additional fi⁄@°dONLNdˇˇ)úelds..°dONLNdˇˇ(ã䯰dONLNdˇˇ)ioSlot°dONLNdˇˇ)Q
  4091. SignedByte.°dONLNdˇˇ+8 Slot number°dONLNdˇˇ)6..°dONLNdˇˇ(£äưdONLNdˇˇ)ioId°dONLNdˇˇ)Q
  4092. SignedByte.°dONLNdˇˇ+8 Slot r•°dONLNdˇˇ)esourÌ@°dONLNdˇˇ)ce ID.
  4093.     °dONLNdˇˇ(«ä Additional fi|0°dONLNdˇˇ)4elds—multiple devices
  4094. °dONLNdˇˇ(÷äÆ.°dONLNdˇˇ)ioMix°dONLNdˇˇ)QPtr.°dONLNdˇˇ)8!Reserved for use by driver Open rÙ@°dONLNdˇˇ)ñoutine.°dONLNdˇˇ(‚äÆ.°dONLNdˇˇ)ioFlags°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8!Determines number of additional fi⁄@°dONLNdˇˇ)úelds.°dONLNdˇˇ(ÓäÆ.°dONLNdˇˇ)
  4095. ioSEBlkPtr°dONLNdˇˇ)QPtr.°dONLNdˇˇ)8$Pointer to external parameter block.
  4096. °dONLNd HÅ(H DESCRIPTION
  4097. .°dONLNd ä&ü+BThe °dONLNdü&œ)OpenSlot°dONLNdœ&W)0 function is equivalent to the °dONLNd7W&{)àPBOpen°dONLNd={&)$# function, except that it sets the °dONLNd`'ä26(/ä%immediate bit (bit 9) of the trap worR`°dONLNdÖ'62ô)¨d, which signals the R`°dONLNdö&ô2∑)c_OpenR`°dONLNdü'∑2æ) r$¿°dONLNd°'æ2)outine that the .°dONLNd±3ä>2(;ä%parameter block includes additional fi∏`°dONLNd◊32>F)®elds.°dONLNd›BäMπ(Jä
  4098. If the slot r2°dONLNdÍB∫M“)0esourz@°dONLNdÔB“M)ce, which is defi°dONLNdBMˇ)G4ned in the chapter “The Slot Manager” in this book, ˇ˛√¬.°dONLNd4NäYã(Vä=serves a single device, you should clear all the bits of the ˇ˝áÑ≠°dONLNdqMãYµ(VãioFlagsˇ˛√¬≠°dONLNdxNµYΩ)* fip⁄°dONLNd{NæY)    eld and include the °dONLNdèZäeÌ(bäslot number and slot rR`°dONLNd•ZÌe)cesour$¿°dONLNd™Ze>)
  4099. ce ID in the $¿°dONLNd∑Y>eb):ioSlot$¿°dONLNdΩZbey)$ and $¿°dONLNd¬Yyeë)ioID$¿°dONLNdΔZëeõ) fi$¿°dONLNd…Zõe±)
  4100. elds.°dONLNdœiät¿(qä
  4101. If the slot rR`°dONLNd‹i¿t◊)6esour$¿°dONLNd·i◊t≠)/ce serves multiple devices, you should set the $¿°dONLNdh≠t—)÷fMulti$¿°dONLNdi—t)$  bit of the ˇˇCê°dONLNd"täÄ¥(}äioFlagsˇˇ°»°dONLNd)u¥Ä∫)* fÚH°dONLNd+u∫Ää)0ield (clearing all other bits to 0), and specify‰»°dONLNd[uâĨ)œ    , in the ˇˇCê  °dONLNddt≠ÄÈ)$
  4102. ioSEBlkPtrˇˇ°»  °dONLNdnuÈÄÔ)< f<h°dONLNdpuÄ)    ield, an .°dONLNdyÅäåÈ(âäSexternal parameter block that is customized for the devices installed in the slot. °dONLNdÕêäõÇ*7See the chapter “The Slot Manager” in this book for mor_†°dONLNdêÇõ®)¯
  4103. e details.
  4104. °dONLNd∂Hæj(ºHSPECIALU°dONLNd∂kæü)#
  4105.  CONSIDERAÁ°dONLNd ∂ûæ∏)3TIONS
  4106. .°dONLNd&≈ä–ü(ÕäThe °dONLNd*ƒü–œ)OpenSlot°dONLNd2≈œ–‚)0; function may move memory; you should not call it at interrl°dONLNdm≈‚– (Õ‚    upt time.
  4107. .°dONLNdwÎHÛn(ÒHASSEMBL‹è°dONLNd~ÎnÛr)&Yö∫°dONLNdÎsÛ–)-LANGUAGE INFORMA—U°dONLNdêΖÛÂ)]TION
  4108. ˇˇ6=.°dONLNdï˙ä (ä
  4109. The trap macræ⁄°dONLNd¢˙ Ú)@
  4110. o for the ˇ˛lzaë°dONLNd¨˘Û#))OpenSlotˇˇ6=aë°dONLNd¥˙#U)0
  4111.  function is ˇ˛lzH°dONLNd¡˘Vt)3_Openˇˇ6=H°dONLNdΔ˙t)$ ($A200). The immediate bit (bit 9) .°dONLNdÍäÃ(äof the trap woro`°dONLNd˘Ã¸)BHd is set to signal to that the parameter block contains the additional fiU °dONLNdB˝(˝elds..°dONLNdHä#ë( äYï°dONLNdIê#‘)ou must setup rg`°dONLNdX‘#ˆ)Degister     °dONLNd`ˆ#I)"A0 with the addr€`°dONLNdpH#Á)R!ess of the parameter block. When €`°dONLNdëÁ#)ü_Open€`°dONLNdñ#) .°dONLNdó$ä/ç(,ärE°dONLNdò$é/≥)    eturns, r °dONLNd°$≥/)%egister D0 contains the rÍ¿°dONLNd∫$/∏)j%esult code. Register D0 is the only r\İdONLNdfl$π/·)ú
  4112. egister afİdONLNdÈ$·/ )(
  4113. fected by °dONLNdÛ0ä;†(8äthis r˛ °dONLNd˘0†;æ)outine.
  4114.     °dONLNd?äJÿ(GäRegisters on entry
  4115. °dONLNdNäYñ*A0°dONLNdNΔY€)<addr|İdONLNdN€YN)ess of the parameter block
  4116.     °dONLNd6]äh“(eäRegisters on exit
  4117. °dONLNdHläwñ*D0°dONLNdKlΔw…)<rE°dONLNdLl wˆ)
  4118. esult codeˇ¥@ˇ ˇˇˇˇ@
  4119. ˇ·ˇ‚7^
  4120. 4*\˜, Palatino
  4121. .+l"CHAPTER œ´)\1,     Helvetica
  4122.     (@lThe Device Manager4⁄*˙¯
  4123. (‡*1 )-c)22
  4124.     )9Reference to the Device Manager
  4125. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4126. 1/91(¯l Second line.4^*¿¯
  4127. °dONLNd]*eD(c*RESULèU°dONLNd]Deh)T CODES,
  4128. Courier
  4129. .°dONLNd
  4130. klwä+(noErr.°dONLNdl¯w˝)å0°dONLNdlw-)No errE†°dONLNdl.w7)or.°dONLNdvlÇ®(l
  4131. badUnitErr.°dONLNd)wÓÇ˝)Ç–21°dONLNd-wÇ()#Refer⁄ °dONLNd2w(Ç”)&ence number out of range or not in use.°dONLNdYÅlç¥(äl unitEmptyErr.°dONLNdfÇÓç˝)Ç–22°dONLNdjÇçÅ)#DCE points to null driver.°dONLNdÑålòñ(ïlopenErr.°dONLNdåçÓò˝)Ç–23°dONLNdêçòs)#Driver can’t perform rY`°dONLNd¶çsò≥)b
  4132. equested open.°dONLNd¥ól£ú(†ldInstErr.°dONLNdΩòÓ£˝)Ç–26°dONLNd¡ò£@)#
  4133. Couldn’t fiİdONLNdÃòA£|)0nd driver in rƒ†°dONLNd⁄ò|£î);esour ‡°dONLNdflò)ce fi”İdONLNd‰ò¶£≠)le
  4134. °dONLNdÁΩ*≈Q(√*SEE ALSO
  4135. °dONLNdÃl◊+B%For information about the low-level rƆ°dONLNdÃ◊„)§1outine for opening other device drivers, see the .°dONLNdFÿl„v(‡lprR`°dONLNdHÿv„)
  4136. $evious section, which describes the R`°dONLNdl◊„?)•PBOpenR`°dONLNdrÿ?„F)$ r$¿°dONLNdtÿF„e)outine..°dONLNd|Ílı&(Úl)For an example of opening a device driver±†°dONLNd•Í&ı;)∫, see ‡°dONLNd´Í<ıõ)Listing 1-1 on page 1-¿°dONLNd¡Íõı†)_8¿°dONLNd¬Í†ı¢).
  4137. %*-¯4&*-¯ &*&˛
  4138. ˇ·ˇ‚7^
  4139. °dONLNd≈*%l("* CloseDriverˇˇˇˇˇˇ("Ú1
  4140. .°dONLNd—8lCs(@lYï°dONLNd“8rCµ)ou can use the ï°dONLNd·7µC˜)C CloseDriverï°dONLNdÏ8˜C™)B( function to close an open device driver◊†°dONLNd8©C¨)≤.°dONLNdOl[‰(XlFUNCTION CloseDriver°dONLNd4OÍ[Ü)~(refNum: Integer) : OSErr;°dONLNdOglsê(plrefNum.°dONLNdVhÆsÏ)BContains the rπ`°dONLNddhÏs¸)>efereİdONLNdhh˝sv)ence number of the driver ro¿°dONLNdÉhvs‘)yeturned by the driverðdONLNdòh‘s◊)^-°dONLNdôtƸ(|Æopening function.
  4141. °dONLNd´ö*¢c(†* DESCRIPTION
  4142. ˇ˛zr.°dONLNd∑©l¥+BThe ˇ¸Ù‰˙r°dONLNdª®¥¡) CloseDriverˇ˛zr˙r°dONLNdΔ©¡¥û)B4 function closes the device driver indicated by the ˇ¸Ù‰Ht°dONLNd˙®ü¥√)firefNumˇ˛zrHt°dONLNd©√¥Ù)$
  4143.  parameterܰdONLNd
  4144. ©Ù¥¯)1. .°dONLNd µl¿û(ΩlBThe Device Manager completes any pending I/O for this driver and r`°dONLNdNµü¿–(Ωü eleases the °dONLNdZ¡lÉ(…lmemory used by the driver¢`°dONLNds¡‰ÃÊ)x.
  4145. Ÿ*ʯ4⁄*¯,
  4146.  
  4147. Zapf Dingbats
  4148. °dONLNdˇˇ(‡Xs
  4149. °dONLNdˇˇ+W†F°dONLNdˇˇ)ARNING
  4150. ˇ·ˇ‚7^
  4151. °dONLNdu‰lÔr(ÏlY@İdONLNdv‰rÔí)Bou should not close drivers that other applications may be using, °dONLNd∏l˚”(¯lsuch as the Disk Driverœ@°dONLNdœ“˚Á)f, the Œ@°dONLNd’Á˚)AppleTÅİdONLNd€˚i)!alk drivers, and so on.
  4152. u¿°dONLNdˇˇ)es
  4153. ˇˇj®.°dONLNdˇl
  4154. Ä(lThe ˇ˛’PÍ®°dONLNd ˛Ä
  4155. ¬) CloseDriverˇˇj®Í®°dONLNdˇ¬
  4156. °)B3 function is a high-level version of the low-level ˇ˛’P™ê°dONLNdI˛¢
  4157. Ã)‡PBCloseˇˇj®™ê°dONLNdPˇÃ
  4158. ˜)*  function. °dONLNd[ lì(lUse the °dONLNdc
  4159. ìΩ)'PBClose°dONLNdj Ω¢)*1 function when you want to specify a completion rR`°dONLNdõ ¢Í)Âoutine. See the °dONLNd´l"¡(ldescription of the °dONLNdæ¡"Î)UPBClose°dONLNd≈Î"")*
  4160.  function on ,Times°dONLNd“""?)7page 1-°dONLNdŸ?"I)22°dONLNd€I"L)
  4161. .
  4162. .°dONLNd›>*FL(D*SPECIALU°dONLNd‰>MFÅ)#
  4163.  CONSIDERAÁ°dONLNdÓ>ÄFö)3TIONS
  4164. .°dONLNdÙLlWÅ(TlThe °dONLNd¯KÅW√) CloseDriver°dONLNdL√WÀ)B9 function does not move memory; you may call it at interrl°dONLNd<LÀWı(TÀ    upt time.
  4165. .°dONLNdFs*{D(y*RESULèU°dONLNdKsD{h)T CODES
  4166. .°dONLNdSÄlåä+(noErr.°dONLNdYůå˝)å0°dONLNd[Åå/)No Erró¿°dONLNdaÅ/å8)or.°dONLNddãló®(îl
  4167. badUnitErr.°dONLNdoåÓó˝)Ç–21°dONLNdsåó()#Refer⁄ °dONLNdxå(ó”)&ence number out of range or not in use.°dONLNdüñl¢¥(ül unitEmptyErr.°dONLNd¨óÓ¢˝)Ç–22°dONLNd∞ó¢Å)#DCE points to null driver.°dONLNd °l≠®(™l
  4168. notOpenErr.°dONLNd’¢Ó≠˝)Ç–26°dONLNdŸ¢≠\)#Driver isn’t open.°dONLNdΨl∏ú(µlabortErr.°dONLNdÙ≠Ó∏˝)Ç–27°dONLNd¯≠∏/)#Close r@İdONLNdˇ≠0∏ú)equest aborted by KillIOˇ‰@ˇ ˇˇˇˇ@
  4169. ˇ·ˇ‚7^
  4170. 4H\, Palatino
  4171. .+ä"CHAPTER œ´)\1,     Helvetica
  4172.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4173. ~¿(‡1
  4174. ‡)-a¿)23
  4175. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4176. 1/91(¯ä Second line.4^H¿
  4177. °dONLNd]Heo(cHSEE ALSO
  4178. °dONLNd    läw.+B%For information about the low-level rƆ°dONLNd.l.w˜)§0outine for closing device drivers, see the next .°dONLNd^xäÉ(Ääsection, which describes the ,
  4179. Courier°dONLNd{wÉ9)ÖPBClose°dONLNdÇx9Éc)*
  4180.  function.
  4181. ≥Hª4¥Hª ¥H¥
  4182. ˇ·ˇ‚7^
  4183. .°dONLNdé¶H≥u(∞HPBCloseˇˇˇˇˇˇ(∞1
  4184. .°dONLNdñΔä—ë(ŒäYï°dONLNdóΔê—”)ou can use the ï°dONLNd¶≈”—˝)CPBCloseï°dONLNd≠Δ˝—∞)*( function to close an open device driver◊†°dONLNd’ΔØ—≤)≤.°dONLNd◊›äÈÍ(ÊäFUNCTION PBClose°dONLNdÔ›ÍÈ)` °dONLNd›ÈÄ)(paramBlock: ParmBlkPtr;°dONLNdΉ˜Í(Ù‰ °dONLNdÎ͘) °dONLNdÎ˜ˆ) °dONLNdΈ˜Ä)async: Boolean): OSErr;°dONLNd,äΔ( ä
  4185. paramBlock.°dONLNd7ÃÜ)B*Contains a pointer to the parameter block..°dONLNdbä®(äasync.°dONLNdhÃÈ)BSpecifi‡°dONLNdoÈñ)&es to the Device Manager whether the rRİdONLNdïó‚)Æequest is asynchrŒ‡°dONLNd¶‚)Konous. °dONLNdÆ&ä1ê(.äY@İdONLNdØ&ê1ˆ)ou specify values and rP°dONLNdΔ&ˆ1)feceive r¿°dONLNdŒ&1¯)!1eturn values in a Device Manager parameter block.
  4186. >HN4?HM
  4187.     °dONLNdˇˇ(FäParameter block
  4188. ˇ·ˇ‚7^,    Symbol
  4189. °dONLNdˇˇ*Æ.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8Pointer to completion r쇰dONLNdˇˇ)foutine.°dONLNdˇˇ(`ä¨.°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8 Result code.°dONLNdˇˇ(läÆ.°dONLNdˇˇ)ioRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Driver rø¿°dONLNdˇˇ)#eferk‡°dONLNdˇˇ) ence numberÛ¿°dONLNdˇˇ)8.
  4190. °dONLNdßãHìÅ(ëH DESCRIPTION
  4191. .°dONLNd≥ôä§ü+BThe °dONLNd∑òü§…)PBClose°dONLNdæô…§Ç)*) function closes the device driver specifi°dONLNdËôǧ±)π
  4192. ed by the °dONLNdÚò±§·)/ioRefNum°dONLNd˙ô·§Î)0 fi°dONLNd˝ôΧ)
  4193.     eld. The .°dONLNd•ä∞©(≠ä>Device Manager completes any pending I/O for this driver and rƒ†°dONLNdD•©∞(≠©eleases the memory °dONLNdW±äº⁄(πäused by the driverπİdONLNdi±⁄º‹)P.
  4194.  H÷4 H÷,
  4195.  
  4196. Zapf Dingbats
  4197. °dONLNdˇˇ(—vs
  4198. °dONLNdˇˇ)W†F°dONLNdˇˇ)ARNING
  4199. ˇ·ˇ‚7^
  4200. °dONLNdk’ä‡ê(›äY@İdONLNdl’ê‡∞)Bou should not close drivers that other applications may be using, °dONLNdÆ·äÏÒ(Èäsuch as the Disk Driverœ@°dONLNd≈·Ï)f, the Œ@°dONLNdÀ·Ï&)AppleTÅİdONLNd—·&Ïá)!alk drivers, and so on.
  4201. u¿°dONLNdˇˇ)es
  4202. °dONLNd˝ä˚≈(¯äIf the driver rưdONLNd ≈˚);eturns a negative rÀ‡°dONLNd˚=)R
  4203. esult in rÉ °dONLNd)>˚Œ)' egister D0, the Device Manager r@‡°dONLNdIœ˚)ë eturns this .°dONLNdU¸äé(ärR`°dONLNdV¸é›)esult code in the R`°dONLNdh˚›
  4204. )OioResultR`°dONLNdp¸
  4205. »)0( parameter and does not close the driverï°dONLNdò¸« )∫.
  4206. .°dONLNdö"H*j((HSPECIALU°dONLNd°"k*ü)#
  4207.  CONSIDERAÁ°dONLNd´"û*∏)3TIONS
  4208. .°dONLNd±1ä<ü(9äThe °dONLNdµ0ü<…)PBClose°dONLNdº1…<—)*9 function does not move memory; you may call it at interrl°dONLNdı1—<˚(9—    upt time.
  4209. .°dONLNdˇWH_n(]HASSEMBL‹è°dONLNdWn_r)&Yö∫°dONLNdWs_–)-LANGUAGE INFORMA—U°dONLNdW–_Â)]TION
  4210. ˇˇ\.°dONLNdfäq (nä
  4211. The trap macr]°dONLNd*f qÚ)@
  4212. o for the ˇ˛
  4213. ∏m,°dONLNd4eÚq)(PBCloseˇˇ\m,°dONLNd;fqN)*
  4214.  function is ˇ˛
  4215. ∏}@°dONLNdHeNqr)2_Closeˇˇ\}@°dONLNdNfrq)$$ ($A001). Set bit 10 of the trap worzİdONLNdrfq)úd .°dONLNdträ}œ(zäto execute this rı@°dONLNdÖrœ})Eoutine asynchr[¿°dONLNdìr}4)Bonously∏°dONLNdör3}Õ)"%. Set bit 9 to execute it immediatelyù‡°dONLNdørÃ}Œ)ô..°dONLNd¡Ñäèë(åäYï°dONLNd¬Ñêè‘)ou must setup rg`°dONLNd—Ñ‘èˆ)Degister     °dONLNdŸшèI)"A0 with the addr€`°dONLNdÈÑHèÁ)R!ess of the parameter block. When €`°dONLNd
  4216. ÉÁè )ü_Close€`°dONLNdÑ è)$ .°dONLNdêäõç(òärE°dONLNdêéõ≥)    eturns, r °dONLNdê≥õ)%egister D0 contains the rÍ¿°dONLNd4êõ∏)j%esult code. Register D0 is the only r\İdONLNdYêπõ·)ú
  4217. egister afİdONLNdcê·õ )(
  4218. fected by °dONLNdmúä߆(§äthis r˛ °dONLNdsú†ßæ)outine.ˇt@ˇ ˇˇˇˇ@
  4219. ˇ·ˇ‚7^
  4220. 4*\˜, Palatino
  4221. .+l"CHAPTER œ´)\1,     Helvetica
  4222.     (@lThe Device Manager4⁄*˙¯
  4223. (‡*1 )-c)24
  4224.     )9Reference to the Device Manager
  4225. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4226. 1/91(¯l Second line.4^*¿¯
  4227.     °dONLNd\lg∫(dlRegisters on entry
  4228. °dONLNdklvx*A0°dONLNdk®vΩ)<addr|İdONLNdkΩv0)ess of the parameter block
  4229.     °dONLNd5zlÖ¥(ÇlRegisters on exit
  4230. °dONLNdGâlîx*D0°dONLNdJâ®î´)<rE°dONLNdKâ¨îÿ)
  4231. esult code
  4232. °dONLNdVØ*∑D(µ*RESULèU°dONLNd[ØD∑h)T CODES,
  4233. Courier
  4234. .°dONLNdcΩl…ä+(noErr.°dONLNdi毅˝)å0°dONLNdkæ…/)No Erró¿°dONLNdqæ/…8)or.°dONLNdt»l‘®(—l
  4235. badUnitErr.°dONLNd…Ó‘˝)Ç–21°dONLNdÉ…‘()#Refer⁄ °dONLNdà…(‘”)&ence number out of range or not in use.°dONLNdØ”lfl¥(‹l unitEmptyErr.°dONLNdº‘Ófl˝)Ç–22°dONLNd¿‘flÅ)#DCE points to null driver.°dONLNd⁄filÍ®(Ál
  4236. notOpenErr.°dONLNdÂflÓÍ˝)Ç–26°dONLNdÈflÍ\)#Driver isn’t open.°dONLNd˚Èlıú(ÚlabortErr.°dONLNdÍÓı˝)Ç–27°dONLNdÍı/)#Close r@İdONLNdÍ0ıú)equest aborted by KillIO
  4237. °dONLNd(*Q(*SEE ALSO
  4238. °dONLNd1l)+B&For information about the high-level r°dONLNdW)“)®-outine for closing device drivers, see the pr@°dONLNdÑ“)Ò)æevious .°dONLNdã*l5Ò(2lsection, which describes the °dONLNd®)Ò53)Ö CloseDriver°dONLNd≥*35])B
  4239.  function.
  4240. Y*a¯4Z*a¯ Z*Z˛
  4241. ˇ·ˇ‚7^
  4242. .°dONLNdæL*Yd(V*
  4243. Reading FrÌ@°dONLNd»LdYõ):om and W~¿°dONLNd–LõY¬)7riting T¿°dONLNdÿL¬Yı)'    o Devicesˇˇˇˇˇˇ(VÚ1
  4244. .°dONLNd‚blms(jlYï°dONLNd„brm’)ou can use either the ï°dONLNd˘a’m˘)cFSReadï°dONLNdˇb˘m)$ or ï°dONLNdam,)PBReadï°dONLNd    b,mf)$ function to rg`°dONLNdbfmª):ead information fr9¿°dONLNd)bªmı)U om a device °dONLNd5nlyÈ(vldriver and you can use the °dONLNdPmÈy)}FSWrite°dONLNdWny")* or °dONLNd[m"yL)PBWrite°dONLNdbnLyÏ)*$ function to write information to a .°dONLNdÜzlÖ¶(Çl
  4245. device driverI¿°dONLNdìz¶Ö®):..°dONLNdïålóÅ(îlThe °dONLNdôãÅó•)PBRead°dONLNdüå•óº)$ and °dONLNd§ãºóÊ)PBWrite°dONLNd´åÊóà)*# functions use the additional I/O fi°dONLNdœåàó)¢elds of the parameter .°dONLNdÂòl£œ(†lblock, as described on C`°dONLNd¸ò–£)dpage 1-r °dONLNdò£˙) 15r °dONLNdò˙£¸)
  4246. .
  4247. ”*€¯4‘*€¯ ‘*‘˛
  4248. ˇ·ˇ‚7^
  4249. °dONLNdΔ*”S(–*FSReadˇˇˇˇˇˇ(–Ú1
  4250. .°dONLNdÊlÒs(ÓlYï°dONLNdÊrÒµ)ou can use the ï°dONLNdµÒŸ)CFSReadï°dONLNd%ÊŸÒ)$ function to rg`°dONLNd3ÊÒH): ead data fr9¿°dONLNd>ÊHÒ„)5!om an open driver into a data buf  °dONLNd_Ê„Ò)õferN¿°dONLNdbÊÔÒÚ) .°dONLNdd˝l    Δ(lFUNCTION FSRead°dONLNd{˝Δ    Ã)Z °dONLNd|˝Ã    ™)%(refNum: Integer; VAR count: LongInt;°dONLNd™ ΔÃ(Δ °dONLNd´ Ó) °dONLNd¨ “P)buffPtr: Ptr): OSErr;°dONLNd¬#l/ê(,lrefNum.°dONLNd…$Æ/À)BSpecifi‡°dONLNd–$À/Í)es the rô‡°dONLNdÿ$Î/˚) eferF°dONLNd‹$¸/n)ence number of the driverM‡°dONLNdı$n/p)r..°dONLNd˜3l?ä(<lcount.°dONLNd˝4Æ?B)B"Indicates the number of bytes to r·°dONLNd4B?T)îead..°dONLNd$ClOñ(LlbuffPtr.°dONLNd,DÆO)BPoints to a data buf@°dONLNd@DOZ)Vfer to hold the data.
  4251. °dONLNdVj*rc(p* DESCRIPTION
  4252. ˇ˛®.°dONLNdbylÑÖ+BBeforR`°dONLNdgyÖÑæ)e calling the ˇ˝P"Jì°dONLNduxøÑ„):FSReadˇ˛®Jì°dONLNd{y„Ñ–)$6 function, your application should allocate a data buf]{°dONLNd±y–ÑÏ)Ìfer lar◊ϰdONLNd∏yÏј)ge ˇˇ\°dONLNdªÖlêˆ(çlenough to hold the data to be rw‰°dONLNd⁄Öˆê )ä    ead. The ˇ˛
  4253. ∏Çú°dONLNd„Ñ êD)*FSReadˇˇ\Çú°dONLNdÈÖDê¶)$ function attempts to rjl°dONLNdÖ¶ê¯)bead the number of ˇˇ`÷°dONLNdëlú‘(ôlbytes indicated by the ˇ˛¡¨X°dONLNd)ê’úÛ)icountˇˇ`÷X°dONLNd.ëÛú/)
  4254.  parameter fród°dONLNd;ë/ún)<
  4255. om the specifiY°dONLNdIëoúπ)@ed device driver]\°dONLNdYëπú¯)J, and transfer ˇˇ;°dONLNdhùl®Ã(•lthem to this data bufgL°dONLNd}ùîŸ)`fer©Ï°dONLNdÄùÿ®›) . P«°dONLNdÇù›®z)$After the transfer is complete, the ˇ˛
  4256. vp)°dONLNd¶úz®ò)ùcountˇˇ;p)°dONLNd´ùò®¯) parameter indicates .°dONLNd¿©l¥(±lthe number of bytes actually r’İdONLNdfi©¥)Ñead. ˇb@ˇ ˇˇˇˇ@
  4257. ˇ·ˇ‚7^
  4258. 4H\, Palatino
  4259. .+ä"CHAPTER œ´)\1,     Helvetica
  4260.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4261. ~¿(‡1
  4262. ‡)-a¿)25
  4263. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4264. 1/91(¯ä Second line.4^H¿
  4265. ^Hj4^Hj,
  4266.  
  4267. Zapf Dingbats
  4268. 
  4269. °dONLNdˇˇ(dvs
  4270. °dONLNdˇˇ+W†F°dONLNdˇˇ)ARNING
  4271. ˇ·ˇ‚7^
  4272. °dONLNdhäs•(päBe surÓİdONLNdh•s“)
  4273. e your bufkİdONLNdh”s˜).
  4274. fer is larN`°dONLNdh˜s§)$&ge enough to hold the number of bytes .°dONLNd@tä®(|äspecifi°dONLNdGt®◊)
  4275. ed by the ,
  4276. Courier°dONLNdQs◊ı)/count°dONLNdVtı()
  4277.  parameter¬†°dONLNd`t'û)2, or this function may corrƆ°dONLNd{tû∞)wupt .°dONLNdÄäãØ(àämemoryÕ °dONLNdÖÄÆã≥)$. 
  4278. Õ °dONLNdˇˇ)s
  4279. ˇˇI$.°dONLNdúíäùû(öäThe ˇ˛íH…$°dONLNd†ëûù¬)FSReadˇˇI$…$°dONLNd¶í¬ù†)$3 function is a high-level version of the low-level ˇ˛íH[h°dONLNdŸë°ù≈)flPBReadˇˇI$[h°dONLNdflí≈ù)$ function. Use the °dONLNdÚù䩯(¶äPBRead°dONLNd¯ûÆ©1)$ function when you want to rR`°dONLNdû1©t)Éequest asynchr$¿°dONLNd"ût©ì)Conous r˜ °dONLNd)ûí©)eading or need to specify a .°dONLNdE™äµI(≤ä)drive number or a positioning mode and ofŒ`°dONLNdn™Iµ)ø0fset. See the next section, which describes the .°dONLNdûµä¡Æ(æäPBRead°dONLNd§∂Æ¡ÿ)$
  4280.  function.
  4281. .°dONLNdØ›HÂj(„HSPECIALU°dONLNd∂›kÂü)#
  4282.  CONSIDERAÁ°dONLNd¿›ûÂ∏)3TIONS
  4283. .°dONLNdΔÎäˆü(ÛäThe °dONLNd Íüˆ√)FSRead°dONLNd–Î√ˆT)$ function does not move memoryd@°dONLNdÓÎSˆÉ)ê    . However¶‡°dONLNd˜ÎLj◊)/, you should be sury@°dONLNd
  4284. Î◊ˆ)U
  4285. e the device .°dONLNd˜ä"(ˇä driver does not move memory in rõ`°dONLNd7˜"^)òesponse to a rÓİdONLNdE˜^t)<ead r‡°dONLNdJ˜u´) equest befor+`°dONLNdV˜´)6e you call this function °dONLNdoä≠( ä    at interrŸ`°dONLNdx≠’)#    upt time.
  4286. °dONLNdÇ*H2b(0HRESULèU°dONLNdá*b2Ü)T CODES
  4287. .°dONLNdè7äC®+(noErr.°dONLNdï8C)å0°dONLNdó8/CM)No Erró¿°dONLNdù8MCV)or.°dONLNd†BäN¥(KäreadErr.°dONLNd®C N)Ç–19°dONLNd¨C/Nj)#Driver can’t rã°dONLNd∫CjNú); espond to rs@°dONLNd≈CúN≤)2ead rù†°dONLNd C≤N“)equests.°dONLNd“MäYΔ(Vä
  4288. badUnitErr.°dONLNd›N Y)Ç–21°dONLNd·N/YF)#Refer⁄ °dONLNdÊNFYÒ)&ence number out of range or not in use.°dONLNd
  4289. Xäd“(aä unitEmptyErr.°dONLNdY d)Ç–22°dONLNdY/dü)#DCE points to null driver.°dONLNd8cäoΔ(lä
  4290. notOpenErr.°dONLNdCd o)Ç–26°dONLNdGd/oz)#Driver isn’t open.°dONLNdYnäz∫(wäabortErr.°dONLNdbo z)Ç–27°dONLNdfo/zï)#Read aborted by KillIO
  4291. °dONLNd}ïHùo(õHSEE ALSO
  4292. °dONLNdÜ£äÆ.+B%For information about the low-level rƆ°dONLNd´£.Æ_)§ outine for rr°dONLNd∑£`Æá)2    eading fr9 °dONLNd¿£àÆ)( om device drivers, see the next .°dONLNd‡Øä∫(∑äsection, which describes the °dONLNd˝Æ∫3)ÖPBRead°dONLNdØ3∫])$
  4293.  function.
  4294. ÎHÛ4ÎHÚ ÎHÎ
  4295. ˇ·ˇ‚7^
  4296. .°dONLNd›HÍs(ÁHPBReadˇˇˇˇˇˇ(Á1
  4297. .°dONLNd˝äë(äYï°dONLNd˝ê”)ou can use the ï°dONLNd&¸”˜)CPBReadï°dONLNd,˝˜1)$ function to rg`°dONLNd:˝1f): ead data fr9¿°dONLNdE˝f)5!om an open driver into a data buf  °dONLNdf˝)õferN¿°dONLNdi˝
  4298. ) .°dONLNdkä ‰(äFUNCTION PBRead°dONLNdlj Í)Z °dONLNdÉÍ )1(paramBlock: ParmBlkPtr; async: Boolean) : OSErr;°dONLNdµ,ä8Δ(5ä
  4299. paramBlock.°dONLNd¿-Ã8Ü)B*Contains a pointer to the parameter block..°dONLNdÎ<äH®(Eäasync.°dONLNdÒ=ÃHÈ)BSpecifi‡°dONLNd¯=ÈHñ)&es to the Device Manager whether the rRİdONLNd=óH‚)Æequest is asynchrŒ‡°dONLNd/=‚H)Konous. ˇ¸@ˇ ˇˇˇˇ@
  4300. ˇ·ˇ‚7^
  4301. 4*\˜, Palatino
  4302. .+l"CHAPTER œ´)\1,     Helvetica
  4303.     (@lThe Device Manager4⁄*˙¯
  4304. (‡*1 )-c)26
  4305.     )9Reference to the Device Manager
  4306. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4307. 1/91(¯l Second line.4^*¿¯
  4308. °dONLNd]lhr(elY@İdONLNd]rhÿ)ou specify values and rP°dONLNd]ÿh˘)feceive r¿°dONLNd ]˘h⁄)!1eturn values in a Device Manager parameter block.
  4309. t*ѯ4u*ɯ
  4310.     °dONLNdˇˇ(|lParameter block
  4311. ˇ·ˇ‚7^,    Symbol
  4312. °dONLNdˇˇ*Æ,
  4313. Courier.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8Pointer to completion r쇰dONLNdˇˇ)foutine.°dONLNdˇˇ(ñl¨.°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8 Result code.°dONLNdˇˇ(¢lÆ.°dONLNdˇˇ)    ioVRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8 Drive number; °dONLNdˇˇ)>.°dONLNdˇˇ(ÆlÆ.°dONLNdˇˇ)ioRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Driver rø¿°dONLNdˇˇ)#eferk‡°dONLNdˇˇ) ence numberÛ¿°dONLNdˇˇ)8.°dONLNdˇˇ(∫lÆ.°dONLNdˇˇ)ioBuffer°dONLNdˇˇ)QPtr.°dONLNdˇˇ)8Pointer to data bufİdONLNdˇˇ)SferU@°dONLNdˇˇ) .°dONLNdˇˇ(ΔlÆ.°dONLNdˇˇ)
  4314. ioReqCount°dONLNdˇˇ)QLongInt.°dONLNdˇˇ)8Requested number of bytes to r‹†°dONLNdˇˇ)äead.°dONLNdˇˇ(“l¨.°dONLNdˇˇ)
  4315. ioActCount°dONLNdˇˇ)QLongInt.°dONLNdˇˇ)8Actual number of bytes r«‡°dONLNdˇˇ)nead.°dONLNdˇˇ(filÆ.°dONLNdˇˇ)    ioPosMode°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Positioning mode.°dONLNdˇˇ(Íl´.°dONLNdˇˇ) ioPosOffset°dONLNdˇˇ)QLongInt.°dONLNdˇˇ)8Positioning of˙¿°dONLNdˇˇ)=fset.
  4316. °dONLNdJ    *c(* DESCRIPTION
  4317. ˇ˛®.°dONLNdVl"Ö+BBeforR`°dONLNd[Ö"æ)e calling the ˇ˝P"Jì°dONLNdiø"„):PBReadˇ˛®Jì°dONLNdo„"–)$6 function, your application should allocate a data buf]{°dONLNd•–"Ï)Ìfer lar◊ϰdONLNd¨Ï"˜)ge ˇˇ\°dONLNdØ#l.ˆ(+lenough to hold the data to be rw‰°dONLNdŒ#ˆ. )ä    ead. The ˇ˛
  4318. ∏Çú°dONLNd◊" .D)*PBReadˇˇ\Çú°dONLNd›#D.¶)$ function attempts to rjl°dONLNdÙ#¶.¯)bead the number of ˇˇ>ï°dONLNd/l:”(7lbytes indicated by the ˇ˛}*zT°dONLNd.‘:)h
  4319. ioReqCountˇˇ>ïzT°dONLNd'/:)< fi∏ȰdONLNd*/:2)    eld fr…fi°dONLNd0/2:q)
  4320. om the specifiG°dONLNd>/r:¯)@ed device driver and transfer ˇ˛º°dONLNd\;lF (Clthem to this data bufB¿°dONLNdq;ÀFÿ)_ferÖ`°dONLNdt;◊F€) . „°dONLNdv;€Fv)$After the transfer is complete, the ˇ˝x0K®°dONLNdö:wF≥)ú
  4321. ioActCountˇ˛ºK®°dONLNd§;≥Fª)< fi¿°dONLNdß;ºF¯)    eld indicates .°dONLNdµGlR(Olthe number of bytes actually r’İdONLNd”GR)Ñead.
  4322. `*l¯4`*l¯,
  4323.  
  4324. Zapf Dingbats
  4325. °dONLNdˇˇ(gXs
  4326. °dONLNdˇˇ)W†F°dONLNdˇˇ)ARNING
  4327. ˇ·ˇ‚7^
  4328. °dONLNdÿklvá(slBe surÓİdONLNdfikáv¥)
  4329. e your bufkİdONLNdËkµvŸ).
  4330. fer is larN`°dONLNdÚkŸvÜ)$&ge enough to hold the number of bytes .°dONLNdwlÇä(lspecifi°dONLNdwäÇπ)
  4331. ed by the °dONLNd)vπÇ◊)/count°dONLNd.w◊Ç
  4332. )
  4333.  parameter¬†°dONLNd8w    ÇÄ)2, or this function may corrƆ°dONLNdSwÄÇí)wupt .°dONLNdWÉléë(ãlmemoryÕ °dONLNd]Éêéï)$. 
  4334. Õ °dONLNdˇˇ)s
  4335. ˇ˛œ˛.°dONLNdtïl†)(ùl,For block devices such as disk drivers, the ˇ˝ü¸ˇ°dONLNd†î)†M)ΩPBReadˇ˛œ˛ˇ°dONLNd¶ïM†˜)$( function allows you to specify a drive °dONLNdŒ°l¨Æ(©lnumber in the °dONLNd‹†Æ¨‰)B    ioVRefNum°dONLNd°‰¨Ó)6 fi°dONLNd˰ӨØ)
  4336. )eld and specify a positioning mode and ofR`°dONLNd°Ø¨‚)¡ fset in the °dONLNd¨l∏¢(µl    ioPosMode°dONLNd&≠¢∏π)6 and °dONLNd+¨π∏˚) ioPosOffset°dONLNd6≠˚∏)B fPİdONLNd8≠∏)ields. PİdONLNd?≠∏x)Bits 0 and 1 of the PİdONLNdS¨x∏Æ)Y    ioPosModePİdONLNd\≠Æ∏µ)6 f!°dONLNd^≠µ∏Ù)ield indicate .°dONLNdlπlƒÇ(¡lwher7°dONLNdpπɃ)e an operation should begin r¿°dONLNdçπƒÃ)Å/elative to the physical beginning of the block-°dONLNdº≈l–ƒ(Õlformatted medium. I`°dONLNdŒ≈≈–À)YY    ‡°dONLNdœ≈À–Ì)Eou can use the following constants to test or set the value of these °dONLNd—l‹~(Ÿlbits:.°dONLNdËlÙΔ*CONST fsAtMark °dONLNd+ËΔÙ“)Z  °dONLNd-Ë“Ù) = 0; °dONLNd3ËÙn){at current position}°dONLNdIˆlr(ˇl °dONLNdJˆrx) °dONLNdKˆx~) °dONLNdLˆ~Ñ) °dONLNdMˆÑä) °dONLNdNˆäê) °dONLNdOˆêfi)
  4337. fsFromStart= °dONLNd\ˆfiÍ)N1;°dONLNd_ˆÍz)  {offset from beginning}°dONLNdxlr(
  4338. l °dONLNdyrx) °dONLNdzx~) °dONLNd{~Ñ) °dONLNd|Ñä) °dONLNd}äê) °dONLNd~ê“) fsFromMark °dONLNdâ“Í)B= 2;°dONLNdéͧ) {offset from current position}.°dONLNdÆl((%l$After the transfer is complete, the «@°dONLNd“(4)ñ ioPosOffset≠‡°dONLNd›5(=)3 fi:†°dONLNd‡>(ö)    eld indicates the curr ‡°dONLNdˆõ(Ì)]ent position of the °dONLNd
  4339. )l4•(1l
  4340. block device.ˇˇ-+.°dONLNd;lF*&The Disk Driver allows you to use the ˇ˛ZVÈX°dONLNd>:F>)ÆPBReadˇˇ-+ÈX°dONLNdD;>F˜)$+ function to verify that data written to a ˇˇ…†°dONLNdoGlR+(Ol'block device matches the data in memory°dONLNdñG+R0)ø. Á†°dONLNdòG0R6)T¸†°dONLNdôG5Rx)o do this, call ˇˇì@# °dONLNd©FyRù)DPBReadˇˇ…†# °dONLNdØGùR¯)$ immediately after .°dONLNd¬Sl^‹([lwriting the data, and add`°dONLNd€S›^Û)q the rø¿°dONLNd·SÛ^H)ead-verify constant.°dONLNdıjlv‰(slCONST rdVerify = 64;°dONLNd    j‰vV)x {read-verify mode}°dONLNdÉléã(ãlto the °dONLNd$Çãé¡)    ioPosMode°dONLNd-É¡éÀ)6 fi°dONLNd0ÉÀéJ)
  4341. eld of the parameter block.ˇ`@ˇ ˇˇˇˇ@
  4342. ˇ·ˇ‚7^
  4343. 4H\, Palatino
  4344. .+ä"CHAPTER œ´)\1,     Helvetica
  4345.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4346. ~¿(‡1
  4347. ‡)-a¿)27
  4348. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4349. 1/91(¯ä Second line.4^H¿
  4350. °dONLNd]Hej(cHSPECIALU°dONLNd]keü)#
  4351.  CONSIDERAÁ°dONLNd]ûe∏)3TIONS
  4352. .°dONLNdläwü(täThe ,
  4353. Courier°dONLNdküw√)PBRead°dONLNd!l√wT)$ function does not move memoryd@°dONLNd?lSwÉ)ê    . However¶‡°dONLNdHlÇw◊)/, you should be sury@°dONLNd[l◊w)U
  4354. e the device .°dONLNdhxäÉ"(Ää driver does not move memory in rõ`°dONLNdàx"É^)òesponse to a rÓİdONLNdñx^Ét)<ead r‡°dONLNdõxuÉ´) equest befor+`°dONLNdßx´É)6e you call this function °dONLNd¿Ñäè≠(åä    at interrŸ`°dONLNd…Ñ≠è’)#    upt time.
  4355. °dONLNd”™H≤n(∞HASSEMBL‹è°dONLNd⁄™n≤r)&Yö∫°dONLNd€™s≤–)-LANGUAGE INFORMA—U°dONLNdÏ™–≤Â)]TION
  4356. ˇˇH.°dONLNdÒπ䃠(¡ä
  4357. The trap macrx°dONLNd˛π ƒÚ)@
  4358. o for the ˇ˛&ê≤»°dONLNd∏Úƒ)(PBReadˇˇH≤»°dONLNdπƒH)$
  4359.  function is ˇ˛&êφ°dONLNd∏Hƒf)2_ReadˇˇHφ°dONLNd πfƒ)$ ($A002). Set bit 10 of the trap worY@°dONLNdDπƒ)ùd to .°dONLNdI≈ä–ƒ(Õäexecute this rΩ`°dONLNdW≈ƒ–):outine asynchr#‡°dONLNde≈–))BonouslyÄ °dONLNdl≈(–¬)"%. Set bit 9 to execute it immediatelyf°dONLNdë≈¡–√)ô..°dONLNdì◊ä‚ë(fläYï°dONLNdî◊ê‚‘)ou must setup rg`°dONLNd£◊‘‚ˆ)Degister     °dONLNd´◊ˆ‚I)"A0 with the addr€`°dONLNdª◊H‚Á)R!ess of the parameter block. When €`°dONLNd‹÷Á‚)ü_Read€`°dONLNd·◊‚) .°dONLNd‚„äÓç(ÎärE°dONLNd„„éÓ≥)    eturns, r °dONLNdÏ„≥Ó)%egister D0 contains the rÍ¿°dONLNd„Ó∏)j%esult code. Register D0 is the only r\İdONLNd*„πÓ·)ú
  4360. egister afİdONLNd4„·Ó )(
  4361. fected by °dONLNd>Ôä˙†(˜äthis r˛ °dONLNdDÔ†˙æ)outine.
  4362.     °dONLNdL˛ä    ÿ(äRegisters on entry
  4363. °dONLNd_
  4364. äñ*A0°dONLNdb
  4365. Δ€)<addr|İdONLNdf
  4366. €N)ess of the parameter block
  4367.     °dONLNdÅä'“($äRegisters on exit
  4368. °dONLNdì+ä6ñ*D0°dONLNdñ+Δ6…)<rE°dONLNdó+ 6ˆ)
  4369. esult code
  4370. °dONLNd¢QHYb(WHRESULèU°dONLNdßQbYÜ)T CODES
  4371. .°dONLNdØ_äk®+(noErr.°dONLNdµ`k)å0°dONLNd∑`/kK)No errE†°dONLNdΩ`LkU)or.°dONLNd¿jäv¥(säreadErr.°dONLNd»k v)Ç–19°dONLNdÃk/vj)#Driver can’t rã°dONLNd⁄kjvú); espond to rs@°dONLNdÂkúv≤)2ead rù†°dONLNdÍk≤v“)equests.°dONLNdÚuäÅΔ(~ä
  4372. badUnitErr.°dONLNd˝v Å)Ç–21°dONLNdv/ÅF)#Refer⁄ °dONLNdvFÅÒ)&ence number out of range or not in use.°dONLNd-Ääå“(âä unitEmptyErr.°dONLNd:Å å)Ç–22°dONLNd>Å/åü)#DCE points to null driver.°dONLNdXãäóΔ(îä
  4373. notOpenErr°dONLNdcå ó)Ç–26.°dONLNdgå/óz)#Driver isn’t open.°dONLNdyñä¢∫(üäabortErr.°dONLNdÇó ¢)Ç–27°dONLNdÜó/¢ï)#Read aborted by KillIO.°dONLNdù°ä≠®(™äioErr°dONLNd£¢ ≠)Ç–36.°dONLNdߢ/≠ñ)#Data doesn’t match in r…@°dONLNdæ¢ñ≠fl)gead-verify mode
  4374. °dONLNdŒ«Hœo(ÕHSEE ALSO
  4375. °dONLNd◊÷ä·1+B&For information about the high-level r°dONLNd˝÷2·c)® outine for r◊`°dONLNd    ÷c·ä)1    eading frûİdONLNd÷ã·)(om device drivers, see the .°dONLNd-‚äÌî(ÍäprR`°dONLNd/‚îÌ9)
  4376. $evious section, which describes the R`°dONLNdS·9Ì])•FSReadR`°dONLNdY‚]Ìä)$  function. 
  4377. ,H44-H4 -H-
  4378. ˇ·ˇ‚7^
  4379. .°dONLNdfH,b()HFSWù°dONLNdia,s)riteˇˇˇˇˇˇ()1
  4380. .°dONLNdn?äJë(GäYï°dONLNdo?êJ”)ou can use the ï°dONLNd~>”J˝)CFSWriteï°dONLNdÖ?˝Jp)* function to write data frg`°dONLNdü?pJ∞)s
  4381. om a data buf9¿°dONLNd¨?∞J)@fer to an open driver|`°dONLNd¡?J)^.°dONLNd√VäbÍ(_äFUNCTION FSWrite°dONLNd€VÍb)` °dONLNd‹VbŒ)%(refNum: Integer; VAR count: LongInt;°dONLNd
  4382. d‰pÍ(m‰ °dONLNd dÍp) °dONLNd dpˆ) °dONLNd
  4383. dˆpz)buffPtr: Ptr) : OSErr;°dONLNd$|äàÆ(ÖärefNum.°dONLNd+}ÃàÈ)BSpecifi‡°dONLNd2}Èà)es the rô‡°dONLNd:}    à) eferF°dONLNd>}àå)ence number of the driverM‡°dONLNdW}åàé)r..°dONLNdYåäò®(ïäcount.°dONLNd_çÃòv)B'Indicates the number of bytes to write..°dONLNdáú䮥(•äbuffPtr.°dONLNdèùî*)BPoints to the data buf‡†°dONLNd•ù*®ç)^fer that holds the data.ˇä@ˇ ˇˇˇˇ@
  4384. ˇ·ˇ‚7^
  4385. 4*\˜, Palatino
  4386. .+l"CHAPTER œ´)\1,     Helvetica
  4387.     (@lThe Device Manager4⁄*˙¯
  4388. (‡*1 )-c)28
  4389.     )9Reference to the Device Manager
  4390. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4391. 1/91(¯l Second line.4^*¿¯
  4392. °dONLNd]*ec(c* DESCRIPTION
  4393. .°dONLNd llwÅ+BThe ,
  4394. Courier°dONLNdkÅw´)FSWrite°dONLNdl´w÷)*A function attempts to write the number of bytes indicated by the °dONLNdXk÷wÙ(t÷count°dONLNd]lÙw˜) ˇˇÜɰdONLNd^xlɶ(Äl parameter frÿ„°dONLNdjx¶ÉÓ):om the data buf>ðdONLNdyxÔÉO)Ifer pointed to by the ˇˇ
  4395. fl[°dONLNdèwOÉy)`buffPtrˇˇÜÉfl[°dONLNdñxyÉÍ)* parameter to the specifi˘g°dONLNdØxÍɘ)qed ˇ˛≥]°dONLNd≤Ñlè®(ål
  4396. device driveru˝°dONLNdøÑ®è¨)<.  ˙°dONLNd¡Ñ¨èG)$After the transfer is complete, the ˇ˝f∫ˇ(°dONLNdÂÉGèe)õcountˇ˛≥]ˇ(°dONLNdÍÑeè˜)  parameter indicates the number .°dONLNd
  4397. êlõŸ(òlof bytes actually written.ˇˇƒÍ.°dONLNd%ül™Ä*The ˇˇâ‘DͰdONLNd)ûÅ™´)FSWriteˇˇƒÍDͰdONLNd0ü´™ç)*3 function is a high-level version of the low-level ˇˇâ‘1$°dONLNdcûé™∏)„PBWriteˇˇƒÍ1$°dONLNdjü∏™¯)* function. Use °dONLNdy´l∂(≥lthe °dONLNd}™∂©)PBWrite°dONLNdÑ´©∂,)* function when you want to rR`°dONLNd†´,∂o)Éequest asynchr$¿°dONLNdÆ´o∂fl)Conous writing or need to .°dONLNd«∑l¬T(øl3specify a drive number or a positioning mode and of¿°dONLNd˙∑U¬‚)È"fset. See the next section, which .°dONLNd√lŒ´(Àldescribes the °dONLNd*¬´Œ’)?PBWrite°dONLNd1√’Œo)*# function, for further information.
  4398. .°dONLNdUÈ*ÒL(Ô*SPECIALU°dONLNd\ÈMÒÅ)#
  4399.  CONSIDERAÁ°dONLNdfÈÄÒö)3TIONS
  4400. ˇˇ…†.°dONLNdl¯lÄ(lThe ˇˇì@I†°dONLNdp˜Å´)FSWriteˇˇ…†I†°dONLNdw¯´:)* function does not move memory°dONLNdï¯:i)è    . However*@°dONLNdû¯iΩ)/, you should be sur# °dONLNd±¯Ω¯)T
  4401. e the device .°dONLNdæl( l driver does not move memory in rõ`°dONLNdfiZ)òesponse to a write r¨Ä°dONLNdÚZê)V equest beforø°dONLNd˛êˆ)6e you call this function °dONLNdlè(l    at interrŸ`°dONLNd è∑)#    upt time.
  4402. °dONLNd*6*>D(<*RESULèU°dONLNd/6D>h)T CODES
  4403. .°dONLNd7DlPä+(noErr.°dONLNd=E¯P˝)å0°dONLNd?EP-)No errE†°dONLNdEE.P7)or.°dONLNdHOl[ñ(XlwritErr.°dONLNdPPÓ[˝)Ç–20°dONLNdTP[L)#Driver can’t rã°dONLNdbPL[ó);espond to write r1@°dONLNdsPò[∏)Lequests.°dONLNd{Zlf®(cl
  4404. badUnitErr.°dONLNdÜ[Óf˝)Ç–21°dONLNdä[f()#Refer⁄ °dONLNdè[(f”)&ence number out of range or not in use.°dONLNd∂elq¥(nl unitEmptyErr.°dONLNd√fÓq˝)Ç–22°dONLNd«fqÅ)#DCE points to null driver.°dONLNd·pl|®(yl
  4405. notOpenErr.°dONLNdÏqÓ|˝)Ç–26°dONLNdq|\)#Driver isn’t open.°dONLNd{láú(ÑlabortErr.°dONLNd |Óá˝)Ç–27°dONLNd|á)#W¬†°dONLNd|áx)    rite aborted by KillIO
  4406. °dONLNd'°*©Q(ß*SEE ALSO
  4407. °dONLNd0∞lª+B%For information about the low-level rƆ°dONLNdU∞ªÊ)§3outine for writing to device drivers, see the next .°dONLNdàºl«Ò(ƒlsection, which describes the °dONLNd•ªÒ«)ÖPBWrite°dONLNd¨º«E)*
  4408.  function.
  4409.     *¯4
  4410. *¯ 
  4411. *
  4412. ˛
  4413. ˇ·ˇ‚7^
  4414. .°dONLNd∏¸*    E(*PBWÚ@°dONLNdª¸D    V)riteˇˇˇˇˇˇ(Ú1
  4415. .°dONLNd¿l's($lYï°dONLNd¡r'µ)ou can use the ï°dONLNd–µ'fl)CPBWriteï°dONLNd◊fl'R)* function to write data frg`°dONLNdÒR'í)s
  4416. om a data buf9¿°dONLNd˛í'Ò)@fer to an open driver|`°dONLNd'Û)^.°dONLNd3l?¢(<l    FUNCTION °dONLNd3¢?Ã)6PBWrite°dONLNd-3Ã?“)* °dONLNd.3“?b)(paramBlock: ParmBlkPtr;°dONLNdOAΔMÃ(JΔ °dONLNdPAÃM“) °dONLNdQA“Mb) async: Boolean): OSErr;°dONLNdjYle®(bl
  4417. paramBlock.°dONLNduZÆeh)B*Contains a pointer to the parameter block..°dONLNd†iluä(rlasync.°dONLNd¶jÆuÀ)BSpecifi‡°dONLNd≠jÀux)&es to the Device Manager whether the rRİdONLNd”jyuƒ)Æequest is asynchrŒ‡°dONLNd‰jƒu‰)Konous. ˇ‹@ˇ ˇˇˇˇ@
  4418. ˇ·ˇ‚7^
  4419. 4H\, Palatino
  4420. .+ä"CHAPTER œ´)\1,     Helvetica
  4421.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4422. ~¿(‡1
  4423. ‡)-a¿)29
  4424. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4425. 1/91(¯ä Second line.4^H¿
  4426. °dONLNd]ähê(eäY@İdONLNd]êhˆ)ou specify values and rP°dONLNd]ˆh)feceive r¿°dONLNd ]h¯)!1eturn values in a Device Manager parameter block.
  4427. uHÖ4vHÑ
  4428.     °dONLNdˇˇ(}äParameter block
  4429. ˇ·ˇ‚7^,    Symbol
  4430. °dONLNdˇˇ*Æ,
  4431. Courier.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8Pointer to completion r쇰dONLNdˇˇ)foutine.°dONLNdˇˇ(óä¨.°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8 Result code.°dONLNdˇˇ(£äÆ.°dONLNdˇˇ)    ioVRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8 Drive number; °dONLNdˇˇ)>.°dONLNdˇˇ(ØäÆ.°dONLNdˇˇ)ioRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Driver rø¿°dONLNdˇˇ)#eferk‡°dONLNdˇˇ) ence numberÛ¿°dONLNdˇˇ)8.°dONLNdˇˇ(ªäÆ.°dONLNdˇˇ)ioBuffer°dONLNdˇˇ)QPtr.°dONLNdˇˇ)8Pointer to data bufİdONLNdˇˇ)SferU@°dONLNdˇˇ) .°dONLNdˇˇ(«äÆ.°dONLNdˇˇ)
  4432. ioReqCount°dONLNdˇˇ)QLongInt.°dONLNdˇˇ)8#Requested number of bytes to write.°dONLNdˇˇ(”ä¨.°dONLNdˇˇ)
  4433. ioActCount°dONLNdˇˇ)QLongInt.°dONLNdˇˇ)8Actual number of bytes written.°dONLNdˇˇ(fläÆ.°dONLNdˇˇ)    ioPosMode°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Positioning mode..°dONLNdˇˇ(Îä´°dONLNdˇˇ) ioPosOffset°dONLNdˇˇ)QLongInt.°dONLNdˇˇ)8Positioning of˙¿°dONLNdˇˇ)=fset.
  4434. °dONLNdN
  4435. HÅ(H DESCRIPTION
  4436. .°dONLNdZä#ü+BThe °dONLNd^ü#…)PBWrite°dONLNde…#Ù)*A function attempts to write the number of bytes indicated by the ˇ˛:Ù°dONLNd¶#ä/Δ(,ä
  4437. ioReqCountˇˇz°dONLNd∞$Δ/Ã)< fm˙°dONLNd≤$Ã/È)ield fr]‘°dONLNdπ$È/0)om the data bufࢰdONLNd»$0/é)Gfer pointed to by the ˇ˛:Ù°dONLNdfi#è/ø)_ioBufferˇˇz°dONLNdÊ$ø/≈)0 f    ˛°dONLNdË$≈/)ield to the driver ˇˇ.¢°dONLNd˚0ä;®(8äspecifi°dONLNd0®;‘)
  4438. ed by the ˇ˛]D ʰdONLNd /’;)-ioRefNumˇˇ.¢ ʰdONLNd0;)0 fi:à°dONLNd0;")    eld. 
  4439.  °dONLNd0";¿)$After the transfer is complete, the ˇ˛]D"ñ°dONLNd@/¿;¸)û
  4440. ioActCountˇˇ.¢"ñ°dONLNdJ0¸;)< fiQ8°dONLNdM0;)    eld .°dONLNdQ<äGW(Dä/indicates the number of bytes actually written..°dONLNdÅNäYQ*,For block devices such as disk drivers, the °dONLNd≠MQY{)«PBWrite°dONLNd¥N{Y)*" function allows you to specify a ˇˇú£°dONLNd÷ZäeÊ(bädrive number in the ˇˇ9FÚå°dONLNdÍYÊe)\    ioVRefNumˇˇú£Úå°dONLNdÛZe%)6 fiè/°dONLNdˆZ&e‰)
  4441. )eld and specify a positioning mode and of™°dONLNdZ‰e)æ fset in the ˇ˛”à°dONLNd+eäq¿(nä    ioPosModeˇˇiƒ°dONLNd4f¿q’)6 and ˇ˛”àSà°dONLNd9e÷q) ioPosOffsetˇˇiƒSà°dONLNdDfq)B fçðdONLNdFfq:)ields. ˜ê°dONLNdMf:qè)Bits 0 and 1 of the ˇ˛”àr(°dONLNdaeêq“)V ioPosOffsetˇˇiƒr(°dONLNdlf“qÿ)B f¨l°dONLNdnfÿq)ield indicate .°dONLNd|rä}†(zäwher7°dONLNdÄr°}")e an operation should begin r¿°dONLNdùr"}Í)Å/elative to the physical beginning of the block-°dONLNdÃ~äâ‚(Üäformatted medium. I`°dONLNdfi~„âÈ)YY    ‡°dONLNdfl~Èâ )Eou can use the following constants to test or set the value of these °dONLNd$ääïú(íäbits:.°dONLNd,°ä≠‰*CONST fsAtMark °dONLNd;°‰≠)Z  °dONLNd=°≠) = 0;°dONLNdB°≠å) {at current position}°dONLNdYØäªê(∏ä °dONLNdZØêªñ) °dONLNd[Øñªú) °dONLNd\Øúª¢) °dONLNd]Ø¢ª®) °dONLNd^Ø®ªÆ) °dONLNd_ØÆª¸)
  4442. fsFromStart= °dONLNdlظª)N1;°dONLNdoتò)  {offset from beginning}°dONLNdàΩä…ê(Δä °dONLNdâΩê…ñ) °dONLNdäΩñ…ú) °dONLNdãΩú…¢) °dONLNdåΩ¢…®) °dONLNdçΩ®…Æ) °dONLNdéΩÆ…) fsFromMark °dONLNdôΩ…)B= 2;°dONLNdûΩ…¬) {offset from current position}.°dONLNdæ÷ä· (fiä$After the transfer is complete, the «@°dONLNd‚÷ ·R)ñ ioPosOffset≠‡°dONLNdÌ÷S·[)3 fi:†°dONLNd÷\·Œ)    eld indicates the new curr}‡°dONLNd
  4443. ÷Œ·)rent position of °dONLNd‚äÌÀ(Íäa block device.
  4444. °dONLNd*    Hj(HSPECIALU°dONLNd1    kü)#
  4445.  CONSIDERAÁ°dONLNd;    û∏)3TIONS
  4446. ˇˇ…†.°dONLNdAä"û(äThe ˇˇì@I†°dONLNdEü"…)PBWriteˇˇ…†I†°dONLNdL…"X)* function does not move memory°dONLNdjX"á)è    . However*@°dONLNdsá"€)/, you should be sur# °dONLNdÜ€")T
  4447. e the device .°dONLNdì#ä."(+ä driver does not move memory in rõ`°dONLNd≥#".x)òesponse to a write r¨Ä°dONLNd«#x.Æ)V equest beforø°dONLNd”#Æ.)6e you call this function °dONLNdÏ/ä:≠(7ä    at interrŸ`°dONLNdı/≠:’)#    upt time.
  4448. °dONLNdˇVH^n(\HASSEMBL‹è°dONLNdVn^r)&Yö∫°dONLNdVs^–)-LANGUAGE INFORMA—U°dONLNdV–^Â)]TION
  4449. ˇˇ\.°dONLNddäo (lä
  4450. The trap macr]°dONLNd*d oÚ)@
  4451. o for the ˇ˛
  4452. ∏m,°dONLNd4cÚo)(PBWriteˇˇ\m,°dONLNd;doN)*
  4453.  function is ˇ˛
  4454. ∏}@°dONLNdHcNor)2_Writeˇˇ\}@°dONLNdNdro)$$ ($A003). Set bit 10 of the trap worzİdONLNdrdo)úd .°dONLNdtpä{œ(xäto execute this rı@°dONLNdÖpœ{)Eoutine asynchr[¿°dONLNdìp{4)Bonously∏°dONLNdöp3{Õ)"%. Set bit 9 to execute it immediatelyù‡°dONLNdøpÃ{Œ)ô..°dONLNd¡Çäçë(ääYï°dONLNd¬Çêç‘)ou must setup rg`°dONLNd—Ç‘çˆ)Degister     °dONLNdŸLjçI)"A0 with the addr€`°dONLNdÈÇHçÁ)R!ess of the parameter block. When €`°dONLNd
  4455. ÅÁç )ü_Write€`°dONLNdÇ ç)$ .°dONLNdéäôç(ñärE°dONLNdééô≥)    eturns, r °dONLNdé≥ô)%egister D0 contains the rÍ¿°dONLNd4éô∏)j%esult code. Register D0 is the only r\İdONLNdYéπô·)ú
  4456. egister afİdONLNdcé·ô )(
  4457. fected by °dONLNdmö䕆(¢äthis r˛ °dONLNdsö†•æ)outine.ˇZ@ˇ ˇˇˇˇ@
  4458. ˇ·ˇ‚7^
  4459. 4*\˜, Palatino
  4460. .+l"CHAPTER œ´)\1,     Helvetica
  4461.     (@lThe Device Manager4⁄*˙¯
  4462. (‡*1 )-c)30
  4463.     )9Reference to the Device Manager
  4464. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4465. 1/91(¯l Second line.4^*¿¯
  4466.     °dONLNd\lg∫(dlRegisters on entry
  4467. °dONLNdklvx*A0°dONLNdk®vΩ)<addr|İdONLNdkΩv0)ess of the parameter block
  4468.     °dONLNd5zlÖ¥(ÇlRegisters on exit
  4469. °dONLNdGâlîx*D0°dONLNdJâ®î´)<rE°dONLNdKâ¨îÿ)
  4470. esult code
  4471. °dONLNdVØ*∑D(µ*RESULèU°dONLNd[ØD∑h)T CODES,
  4472. Courier
  4473. .°dONLNdcΩl…ä+(noErr.°dONLNdi毅˝)å0°dONLNdkæ…-)No errE†°dONLNdqæ.…7)or.°dONLNdt»l‘ñ(—lwritErr.°dONLNd|…Ó‘˝)Ç–20°dONLNdÄ…‘L)#Driver can’t rã°dONLNdé…L‘~); espond to rs@°dONLNdô…~‘î)2ead rù†°dONLNdû…î‘¥)equests.°dONLNd¶”lfl®(‹l
  4474. badUnitErr.°dONLNd±‘Ófl˝)Ç–21°dONLNdµ‘fl()#Refer⁄ °dONLNd∫‘(fl”)&ence number out of range or not in use.°dONLNd·filÍ¥(Ál unitEmptyErr.°dONLNdÓflÓÍ˝)Ç–22°dONLNdÚflÍÅ)#DCE points to null driver.°dONLNd Èlı®(Úl
  4475. notOpenErr.°dONLNdÍÓı˝)Ç–26°dONLNdÍı\)#Driver isn’t open.°dONLNd-Ùlú(˝labortErr.°dONLNd6ıÓ˝)Ç–27°dONLNd:ı)#W¬†°dONLNd;ıx)    rite aborted by KillIO
  4476. °dONLNdR*"Q( *SEE ALSO
  4477. °dONLNd[)l4+B&For information about the high-level r°dONLNdÅ)4‘)®.outine for writing to device drivers, see the .°dONLNdØ5l@v(=lprR`°dONLNd±5v@)
  4478. $evious section, which describes the R`°dONLNd’4@E)•FSWriteR`°dONLNd‹5E@o)*
  4479.  function.
  4480. p*x¯4q*x¯ q*q˛
  4481. ˇ·ˇ‚7^
  4482. .°dONLNdÁc*pH(m*Contr˘Ä°dONLNdÏcHpÍ)olling and Monitoring Devicesˇˇˇˇˇˇ(mÚ1
  4483. ˇˇh.°dONLNd
  4484. ylÑs(ÅlYï°dONLNd yrÑ“)ou can use either the ˇ˛–ù(°dONLNd!x“Ѹ)`Controlˇˇhù(°dONLNd(y¸Ñ    )* or ˇ˛–m8°dONLNd,x
  4485. Ñ@)    PBControlˇˇhm8°dONLNd5y@ц)6 function to send contrfl∏°dONLNdLy†Ñ˜)`ol information to a °dONLNd`Ölê™(çl
  4486. device driver¬†°dONLNdmÖ©ê )=, and you can use the ¬†°dONLNdÉÑ ê0)cStatus¬†°dONLNdâÖ0ê?)$ or ¬†°dONLNdçÑ?êo)PBStatus¬†°dONLNdïÖoê„)0 function to obtain status °dONLNd∞ëlú¯(ôlinformation to a device driver¬†°dONLNdŒë˜új)ã. The Device Manager prï°dONLNdÂëjúû)s ovides the ï°dONLNdêûú¬)4KillIOï°dONLNdˆë¬úŸ)$ and °dONLNd˚úl®ú(•lPBKillIO°dONLNdùú®()0  functions for terminating all rR`°dONLNd#ù(®})åequests in a driver¿°dONLNd6ù~®å)V’s r‚ °dONLNd:ùã®Δ)
  4487.  
  4488. equest queue.°dONLNdHØl∫Å(∑lThe °dONLNdLÆÅ∫∑)    PBControl°dONLNdUØ∑∫Ω)6, °dONLNdWÆΩ∫Ì)PBStatus°dONLNd_ØÌ∫)0, and °dONLNdeÆ∫=)    PBKillIO °dONLNdnØ=∫◊)6"functions use the additional contrR`°dONLNdêØ◊∫˜)öol and .°dONLNdóªlΔé(√lstatus fi†°dONLNd†ªèΔS)#-elds of the parameter block, as described on İdONLNdÕªSΔs)ƒpage 1-G@°dONLNd‘ªsΔ}) 16G@°dONLNd÷ª}Δ)
  4489. .
  4490. ˆ*˛¯4˜*˛¯ ˜*˜˛
  4491. ˇ·ˇ‚7^
  4492. °dONLNdŸÈ*ˆS(Û*Controlˇˇˇˇˇˇ(ÛÚ1
  4493. .°dONLNd·    ls(lYï°dONLNd‚    rµ)ou can use the ï°dONLNdÒµfl)CControlï°dONLNd¯    flB)* function to send contrg`°dONLNd    B⁄)c!ol information to a device driver™°dONLNd0    Ÿ‹)ó.°dONLNd2 l,Ã()lFUNCTION Control°dONLNdJ Ã,û)`# (refNum: Integer; csCode: Integer;°dONLNdw.ÿ:h+ csParamPtr: Ptr): OSErr;°dONLNdêFlRê(OlrefNum.°dONLNdóGÆRÏ)BContains the rπ`°dONLNd•GÏR¸)>efereİdONLNd©G˝Ró)"ence number identifying the driverô¿°dONLNdÀGóRô)ö..°dONLNdÕVlbê(_lcsCode.°dONLNd‘WÆb˙)BContains a driverB†°dONLNdÂW˚bı)M8-dependent code specifying the type of information sent..°dONLNdflr®(ol
  4494. csParamPtr.°dONLNd*gÆrQ)B&Contains a pointer to the actual contr<‡°dONLNdPgRrî)§ol information.
  4495. °dONLNd`ç*ïc(ì* DESCRIPTION
  4496. ˇˇB.°dONLNdlúlßÄ+BThe ˇ˛Ñ,¬°dONLNdpõÄß™)ControlˇˇB¬°dONLNdwú™ß†)*7 function sends information to the device driver specifi“Δ°dONLNdØú†ß–)ˆ ed by the rkh°dONLNd∫ú—ß„)1efer=»°dONLNdæú„߯)ence ˇˇ †°dONLNd√®l≥´(∞lnumber in the ˇ˛@•‡°dONLNd—ß´≥œ)?refNumˇˇ †•‡°dONLNd◊®œ≥)$
  4497.  parameterı °dONLNd·®≥z)1. The value you pass in the ˇ˛@MİdONLNd˝ß{≥ü){csCodeˇˇ †MİdONLNd®ü≥¯)$ parameter and the ˇà@ˇ ˇˇˇˇ@
  4498. ˇ·ˇ‚7^
  4499. 4H\, Palatino
  4500. .+ä"CHAPTER œ´)\1,     Helvetica
  4501.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4502. ~¿(‡1
  4503. ‡)-a¿)31
  4504. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4505. 1/91(¯ä Second line.4^H¿
  4506. .°dONLNd]äh:(eä&type of information pointed to by the ,
  4507. Courier°dONLNd&\:hv)∞
  4508. csParamPtr°dONLNd0]vh)<  parameter depend on the driver .°dONLNdPiätÁ(qäbeing called. For morF@°dONLNdeiËtf)^e information, see the specifig°dONLNdÉift’)~c chapters for the standar!İdONLNdùi÷t)p
  4509. d drivers.ˇ˛ˇ˛.°dONLNd®xäÉù(ÄäThe ˇ˝ˇ¸˛°dONLNd¨wûÉ»)Controlˇ˛ˇ˛˛°dONLNd≥x»É£)*3 function is a high-level version of the low-level ˇ˝ˇ¸ϰdONLNdÊw§É⁄)‹    PBControlˇ˛ˇ˛ϰdONLNdÔx⁄É)6 function. Use °dONLNd˛Ñäèù(åäthe °dONLNdÉùè”)    PBControl°dONLNd Ñ”è)6I function, described in the next section, if you need to specify a drive .°dONLNdTêäõ(òänumber or if you want the contr' °dONLNdsêõ&)éol r °dONLNdwê&õÄ)equest to be asynchr™ °dONLNdãêÄõù)Zonous.
  4510. °dONLNdí∂Hæj(ºHSPECIALU°dONLNdô∂kæü)#
  4511.  CONSIDERAÁ°dONLNd£∂ûæ∏)3TIONS
  4512. ˇˇ…†.°dONLNd©≈ä–û(ÕäThe ˇˇì@I†°dONLNd≠ƒü–…)Controlˇˇ…†I†°dONLNd¥≈…–X)* function does not move memory°dONLNd“≈X–á)è    . However*@°dONLNd€≈á–€)/, you should be sur# °dONLNdÓ≈€–)T
  4513. e the device .°dONLNd˚—ä‹"(Ÿä driver does not move memory in rõ`°dONLNd—"‹q)òesponse to a contr˰dONLNd-—q‹)Ool r䇰dONLNd1—Ä‹∂) equest beforù`°dONLNd=—∂‹ı)6e you call this °dONLNdM›äË‘(Âäfunction at interrg†°dONLNd_›’Ë˝)K    upt time.
  4514. °dONLNdiH b(    HRESULèU°dONLNdnb Ü)T CODES
  4515. .°dONLNdvä®+(noErr.°dONLNd|)å0°dONLNd~/K)No errE†°dONLNdÑLU)or.°dONLNdáä(Δ(%ä
  4516. controlErr.°dONLNdí ()Ç–17°dONLNdñ/(j)#Driver can’t rã°dONLNd§j(¡);espond to this contr%‡°dONLNd∏¬(–)Xol r»¿°dONLNdº–(Ï)equest.°dONLNd√'ä3Δ(0ä
  4517. badUnitErr.°dONLNdŒ( 3)Ç–21°dONLNd“(/3F)#Refer⁄ °dONLNd◊(F3Ò)&ence number out of range or not in use.°dONLNd˛2ä>“(;ä unitEmptyErr.°dONLNd 3 >)Ç–22°dONLNd3/>ü)#DCE points to null driver.°dONLNd)=äIΔ(Fä
  4518. notOpenErr.°dONLNd4> I)Ç–26°dONLNd8>/Iz)#Driver isn’t open.°dONLNdJHäT∫(QäabortErr.°dONLNdSI T)Ç–27°dONLNdWI/TH)#ContrÂ@°dONLNd\IHTV)ol rà °dONLNd`IWT√)equest aborted by KillIO
  4519. °dONLNdynHvo(tHSEE ALSO
  4520. °dONLNdÇ}äà.+B%For information about the low-level rƆ°dONLNdß}.àr)§outine for contrkİdONLNd∑}sà    )E$olling device drivers, see the next .°dONLNd€âäî(ëäsection, which describes the °dONLNd¯àîE)Ö    PBControl°dONLNdâEîo)6
  4521.  function.
  4522. ƒHÃ4≈Hà≈H≈
  4523. ˇ·ˇ‚7^
  4524. .°dONLNd
  4525. ∑HƒÅ(¡H    PBControlˇˇˇˇˇˇ(¡1
  4526. .°dONLNd◊ä‚ë(fläYï°dONLNd◊ê‚”)ou can use the ï°dONLNd'÷”‚    )C    PBControlï°dONLNd0◊    ‚l)6 function to send contrg`°dONLNdG◊l‚)c!ol information to a device driver™°dONLNdh◊‚)ó.°dONLNdjÓä˙¿(˜ä    FUNCTION °dONLNdsÓ¿˙ˆ)6    PBControl°dONLNdÑÓˆ˙¸)6 °dONLNdÖÓ¸˙å)(paramBlock: ParmBlkPtr;°dONLNd¶¸‰Í(‰ °dONLNd®¸ˆ¸) °dONLNd©¸¸) °dONLNd™¸å)async: Boolean): OSErr;°dONLNd¬ä Δ(ä
  4527. paramBlock.°dONLNdÕàÜ)B*Contains a pointer to the parameter block..°dONLNd¯$ä0®(-äasync.°dONLNd˛%Ã0È)BSpecifi‡°dONLNd%È0ñ)&es to the Device Manager whether the rRİdONLNd+%ó0‚)Æequest is asynchrŒ‡°dONLNd<%‚0)Konous. °dONLNdD7äBê(?äY@İdONLNdE7êBˆ)ou specify values and rP°dONLNd\7ˆB)feceive r¿°dONLNdd7B¯)!1eturn values in a Device Manager parameter block.
  4528. OH_4PH^
  4529.     °dONLNdˇˇ(WäParameter block
  4530. ˇ·ˇ‚7^,    Symbol
  4531. °dONLNdˇˇ*Æ.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8Pointer to completion r쇰dONLNdˇˇ)foutine.°dONLNdˇˇ(qä¨.°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8 Result code.°dONLNdˇˇ(}äÆ.°dONLNdˇˇ)    ioVRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8 Drive number; °dONLNdˇˇ)>..°dONLNdˇˇ(â䯰dONLNdˇˇ)    ioCRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Driver rø¿°dONLNdˇˇ)#eferk‡°dONLNdˇˇ) ence numberÛ¿°dONLNdˇˇ)8.°dONLNdˇˇ(ïäÆ.°dONLNdˇˇ)csCode°dONLNdˇˇ)QPtr.°dONLNdˇˇ)8T∫¿°dONLNdˇˇ) ype of contrùİdONLNdˇˇ)5ol call.°dONLNdˇˇ(°äÆ.°dONLNdˇˇ)csParam°dONLNdˇˇ)QARRAY[1..10] OF Integer.°dONLNdˇˇ+8 ContrÂ@°dONLNdˇˇ)ol information.ˇ@ˇ ˇˇˇˇ@
  4532. ˇ·ˇ‚7^
  4533. 4*\˜, Palatino
  4534. .+l"CHAPTER œ´)\1,     Helvetica
  4535.     (@lThe Device Manager4⁄*˙¯
  4536. (‡*1 )-c)32
  4537.     )9Reference to the Device Manager
  4538. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4539. 1/91(¯l Second line.4^*¿¯
  4540. °dONLNd]*ec(c* DESCRIPTION
  4541. .°dONLNd llwÅ+BThe ,
  4542. Courier°dONLNdkÅw∑)    PBControl°dONLNdl∑w≥)67 function sends information to the device driver specifi°dONLNdQl≥w‚)¸
  4543. ed by the ˇ˝Kfi°dONLNd[wlÉ¢(Äl    ioCRefNumˇ˛•Ô°dONLNddx¢Éß)6 fˆo°dONLNdfxßÉ1) ield. The value you pass in the ˇ˝Kfi¯°dONLNdÜw2ÉV)ãcsCodeˇ˛•Ô¯°dONLNdåxVÉ[)$ fˆg°dONLNdéx[ɘ)$ield and the type of information in ˇˇŸ!°dONLNd≤Ñlè~(ålthe ˇˇ≤BY!°dONLNd∂Éèª)
  4544. csParamPtrˇˇŸ!Y!°dONLNd¿Ñªè¥)<5 parameter depend on the driver being called. For morÕ™°dONLNdıÑ¥è˜)˘e information, .°dONLNdêlõ©(òlsee the specifiõ¿°dONLNdê©õ)=c chapters for the standarV@°dONLNd-êõC)p
  4545. d drivers.
  4546. °dONLNd8∂*æL(º*SPECIALU°dONLNd?∂MæÅ)#
  4547.  CONSIDERAÁ°dONLNdI∂Äæö)3TIONS
  4548. .°dONLNdO≈l–Å(ÕlThe °dONLNdSƒÅ–∑)    PBControl°dONLNd\≈∑–H)6 function does not move memoryd@°dONLNdz≈G–w)ê    . However¶‡°dONLNdÉ≈v–À)/, you should be sury@°dONLNdñ≈À–Ê)Ue the .°dONLNdú—l‹#(Ÿl'device driver does not move memory in r…@°dONLNd√—#‹r)∑esponse to a contr‡°dONLNd’—s‹Å)Pol r∏¿°dONLNdŸ—Å‹∑) equest beforÀ@°dONLNd—∑‹ˆ)6e you call this °dONLNdı›lË∂(Âlfunction at interrg†°dONLNd›∑Ëfl)K    upt time.
  4549. °dONLNd* P(    *ASSEMBL‹è°dONLNdP T)&Yö∫°dONLNdU ≤)-LANGUAGE INFORMA—U°dONLNd*≤ «)]TION
  4550. ˇˇŸ.°dONLNd/l¨(l
  4551. The trap macrx°dONLNd<¨‘)@
  4552. o for the ˇ˛%≤∞ù°dONLNdF‘
  4553. )(    PBControlˇˇŸ∞ù°dONLNdO
  4554. <)6
  4555.  function is ˇ˛%≤È(°dONLNd\<l)2_ControlˇˇŸÈ(°dONLNddl˜)0! ($A004). Set bit 10 of the trap .°dONLNdÖl)}(&lworİdONLNdà~)Ã)d to execute this r"İdONLNdõÃ)
  4556. )Noutine asynchrâ°dONLNd©
  4557. )0)AonouslyÂ@°dONLNd∞/)…)"%. Set bit 9 to execute it immediatelyÀ °dONLNd’») )ô.ˇˇ∞S.°dONLNd◊0l;s(8lYï°dONLNdÿ0r;µ)ou must setup rxY°dONLNdÁ0µ;÷)Cegister  L°dONLNdÔ0÷;()!A0 with the addr≠•°dONLNdˇ0(;≈)R!ess of the parameter block. When ˇˇ`¶œó°dONLNd /≈;ı)ù_Controlˇˇ∞Sœó°dONLNd(0ı;˜)0 .°dONLNd)<lGo(DlrE°dONLNd*<pGï)    eturns, r °dONLNd3<ïGˇ)%egister D0 contains the rÍ¿°dONLNdL<ˇGö)j%esult code. Register D0 is the only r\İdONLNdq<õG√)ú
  4558. egister afİdONLNd{<√GÌ)(
  4559. fected by °dONLNdÖHlSÇ(Plthis r˛ °dONLNdãHÇS†)outine.
  4560.     °dONLNdìWlb∫(_lRegisters on entry
  4561. °dONLNd¶flqx*A0°dONLNd©f®qΩ)<addr|İdONLNd≠fΩq0)ess of the parameter block
  4562.     °dONLNd»ulÄ¥(}lRegisters on exit
  4563. °dONLNd⁄Ñlèx*D0°dONLNd›Ñ®è´)<rE°dONLNdfiѨèÿ)
  4564. esult code
  4565. °dONLNdÈ™*≤D(∞*RESULèU°dONLNdÓ™D≤h)T CODES
  4566. .°dONLNdˆ∏lƒä+(noErr.°dONLNd¸π¯ƒ˝)å0°dONLNd˛πƒ-)No errE†°dONLNdπ.ƒ7)or.°dONLNd√lœ®(Ãl
  4567. controlErr.°dONLNdƒÓœ˝)Ç–17°dONLNdƒœL)#Driver can’t rã°dONLNd$ƒLœ£);espond to this contr%‡°dONLNd8ƒ§œ≤)Xol r»¿°dONLNd<ƒ≤œŒ)equest.°dONLNdCŒl⁄®(◊l
  4568. badUnitErr.°dONLNdNœÓ⁄˝)Ç–21°dONLNdRœ⁄()#Refer⁄ °dONLNdWœ(⁄”)&ence number out of range or not in use.°dONLNd~ŸlÂ¥(‚l unitEmptyErr.°dONLNdã⁄Ó½)Ç–22°dONLNdè⁄ÂÅ)#DCE points to null driver.°dONLNd©‰l®(Ìl
  4569. notOpenErr°dONLNd¥ÂÓ˝)Ç–26.°dONLNd∏Â\)#Driver isn’t open.°dONLNd Ôl˚ú(¯labortErr.°dONLNd”Ó˚˝)Ç–27°dONLNd◊˚*)#ContrÂ@°dONLNd‹*˚8)ol rà °dONLNd‡9˚•)equest aborted by KillIO
  4570. °dONLNd˘*Q(*SEE ALSO
  4571. °dONLNd$l/+B&For information about the high-level r°dONLNd($/X)®outine for contr–‡°dONLNd8$X/ÿ)Dolling device drivers, see the .°dONLNdW0l;v(8lprR`°dONLNdY0v;)
  4572. $evious section, which describes the R`°dONLNd}/;E)•ControlR`°dONLNdÑ0E;o)*
  4573.  function.
  4574. k*s¯4l*s¯ l*l˛
  4575. ˇ·ˇ‚7^
  4576. .°dONLNdê^*kK(h*Statusˇˇˇˇˇˇ(hÚ1
  4577. .°dONLNdó~lâs(ÜlYï°dONLNdò~râµ)ou can use the ï°dONLNdß}µâŸ)CStatusï°dONLNd≠~Ÿâé)$) function to obtain status information frg`°dONLNd÷~éâÂ)µom a device driver™°dONLNdË~‰âÁ)V.°dONLNdÍïl°Δ(ûlFUNCTION Status°dONLNdïÿ°§)l"(refNum: Integer; csCode: Integer;°dONLNd.£ÿØfi* °dONLNd/£fiØn)csParamPtr: Ptr): OSErr;ˇ@ˇ ˇˇˇˇ@
  4578. ˇ·ˇ‚7^
  4579. 4H\, Palatino
  4580. .+ä"CHAPTER œ´)\1,     Helvetica
  4581.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4582. ~¿(‡1
  4583. ‡)-a¿)33
  4584. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4585. 1/91(¯ä Second line.4^H¿,
  4586. Courier
  4587. .°dONLNd\ähÆ(eärefNum.°dONLNd]Ãh
  4588. )BContains the rπ`°dONLNd]
  4589. h)>efereİdONLNd]hµ)"ence number identifying the driverô¿°dONLNd;]µh∑)ö..°dONLNd=läxÆ(uäcsCode.°dONLNdDmÃx)BContains a driverB†°dONLNdUmx˛)M3-dependent code specifying the type of information °dONLNdàyÃÑœ(ÅÃrE°dONLNdây–Ñ˙)    equested..°dONLNdìàäîΔ(ëä
  4590. csParamPtr.°dONLNdüâÃîì)B.Contains a pointer to the status information r‚İdONLNdÕâìî∂)«eceived.
  4591. °dONLNd÷ØH∑Å(µH DESCRIPTION
  4592. ˇˇ†Ω.°dONLNd‚æä…û+BThe ˇˇAz Ω°dONLNdÊΩü…√)Statusˇˇ†Ω Ω°dONLNdÏæ√…)$  function r4ó°dONLNd˜æ…Ô)-7eturns information about the device driver having the r fl°dONLNd.æÔ…)ˇeferfl?°dONLNd2æ…)ence °dONLNd7 ä’À(“ä
  4593. number specifi°dONLNdE À’˙)A
  4594. ed by the °dONLNdO…˙’)/refNum°dONLNdU ’Q)$
  4595.  parameter¬†°dONLNd_ P’—)2. The value you pass in the ¬†°dONLNd{…—’ı)ÅcsCode¬†°dONLNdÅ ı’¯)$ °dONLNdÇ÷ä·∫(fiä    parameter¬†°dONLNdã÷π·Í)/ , and the rï°dONLNdñ÷Í·ú)1&eceived information pointed to by the ï°dONLNdº’ú·ÿ)≤
  4596. csParamPtrï°dONLNdΔ÷ÿ·)<  parameter .°dONLNd—‚äÌH(Íä*depend on the driver being called. For morb°dONLNd˚‚HÌΔ)æe information, see the specifiÇ¿°dONLNd‚ΔÌ)~c chapters for the °dONLNd,Ó䢴(ˆästandar±Ä°dONLNd3Ó´˘’)!
  4597. d drivers.ˇˇƒÍ.°dONLNd>˝äû(äThe ˇˇâ‘DͰdONLNdB¸ü√)StatusˇˇƒÍDͰdONLNdH˝√•)$3 function is a high-level version of the low-level ˇˇâ‘1$°dONLNd{¸¶÷)„PBStatusˇˇƒÍ1$°dONLNdÉ˝÷)0 function. Use ˇˇ√¡°dONLNdí    äú(äthe ˇˇáÇC¡°dONLNdñùÕ)PBStatusˇˇ√¡C¡°dONLNdû    Õ)0J function if you need to specify a drive number or if you want the status .°dONLNdËä ç(ärE°dONLNdÈé Ë)equest to be asynchr% °dONLNd˝Ë )Zonous.
  4598. °dONLNd;HCj(AHSPECIALU°dONLNd ;kCü)#
  4599.  CONSIDERAÁ°dONLNd;ûC∏)3TIONS
  4600. .°dONLNdJäUü(RäThe °dONLNdIüU√)Status°dONLNd%J√UT)$ function does not move memoryd@°dONLNdCJSUÉ)ê    . However¶‡°dONLNdLJÇU◊)/, you should be sury@°dONLNd_J◊U)U
  4601. e the device .°dONLNdlVäa"(^ä driver does not move memory in rõ`°dONLNdåV"a{)òesponse to a status rt`°dONLNd°V{a±)Y equest befor܇°dONLNd≠V±a)6e you call this °dONLNdΩbäm‘(jäfunction at interrg†°dONLNdœb’m˝)K    upt time.
  4602. °dONLNdŸàHêb(éHRESULèU°dONLNdfiàbêÜ)T CODES
  4603. .°dONLNdÊñ䢮+(noErr.°dONLNdÏó¢)å0°dONLNdÓó/¢K)No errE†°dONLNdÙóL¢U)or.°dONLNd˜°ä≠¿(™ä    statusErr.°dONLNd¢ ≠)Ç–18°dONLNd¢/≠j)#Driver can’t rã°dONLNd¢j≠À);espond to this status r≤@°dONLNd*¢À≠Á)aequest.°dONLNd1¨ä∏Δ(µä
  4604. badUnitErr.°dONLNd<≠ ∏)Ç–21°dONLNd@≠/∏F)#Refer⁄ °dONLNdE≠F∏Ò)&ence number out of range or not in use.°dONLNdl∑ä√“(¿ä unitEmptyErr.°dONLNdy∏ √)Ç–22°dONLNd}∏/√ü)#DCE points to null driver.°dONLNdó¬äŒΔ(Àä
  4605. notOpenErr°dONLNd¢√ Œ)Ç–26.°dONLNd¶√/Œz)#Driver isn’t open.°dONLNd∏ÕäŸ∫(÷äabortErr.°dONLNd¡Œ Ÿ)Ç–27°dONLNd≈Œ/ŸP)#Status rÕ†°dONLNdÕŒPŸº)!equest aborted by KillIO
  4606. °dONLNdÊÛH˚o(˘HSEE ALSO
  4607. °dONLNdÔä
  4608. .+B%For information about the low-level rƆ°dONLNd.
  4609. 
  4610. )§3outine for monitoring device drivers, see the next °dONLNdGäX(ä/section, which describes the PBStatus function.
  4611. XH`4YH` YHY
  4612. ˇ·ˇ‚7^
  4613. °dONLNdxKHXy(UHPBStatusˇˇˇˇˇˇ(U1
  4614. .°dONLNdÅkävë(säYï°dONLNdÇkêv”)ou can use the ï°dONLNdëj”v)CPBStatusï°dONLNdôkv∏)0) function to obtain status information frg`°dONLNd¬k∏v)µom a device driver™°dONLNd‘kv)V.°dONLNd÷ÇäéÜ(ãä*FUNCTION PBStatus (paramBlock: ParmBlkPtr;°dONLNd
  4615. êˆúÄ+l async: Boolan): OSErr;°dONLNd"®ä¥Δ(±ä
  4616. paramBlock.°dONLNd.©Ã¥Ü)B*Contains a pointer to the parameter block.ˇb@ˇ ˇˇˇˇ@
  4617. ˇ·ˇ‚7^
  4618. 4*\˜, Palatino
  4619. .+l"CHAPTER œ´)\1,     Helvetica
  4620.     (@lThe Device Manager4⁄*˙¯
  4621. (‡*1 )-c)34
  4622.     )9Reference to the Device Manager
  4623. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4624. 1/91(¯l Second line.4^*¿¯,
  4625. Courier
  4626. .°dONLNd\lhä(elasync.°dONLNd]ÆhÀ)BSpecifi‡°dONLNd
  4627. ]Àhx)&es to the Device Manager whether the rRİdONLNd3]yhƒ)Æequest is asynchrŒ‡°dONLNdD]ƒh‰)Konous. °dONLNdLolzr(wlY@İdONLNdMorzÿ)ou specify values and rP°dONLNddoÿz˘)feceive r¿°dONLNdlo˘z⁄)!1eturn values in a Device Manager parameter block.
  4628. á*ó¯4à*ñ¯
  4629.     °dONLNdˇˇ(èlParameter block
  4630. ˇ·ˇ‚7^,    Symbol
  4631. °dONLNdˇˇ*Æ.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8Pointer to completion r쇰dONLNdˇˇ)foutine..°dONLNdˇˇ(©l¨°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8 Result code.°dONLNdˇˇ(µlÆ.°dONLNdˇˇ)    ioVRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8 Drive number; °dONLNdˇˇ)>..°dONLNdˇˇ(¡lưdONLNdˇˇ)    ioCRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Driver rø¿°dONLNdˇˇ)#eferk‡°dONLNdˇˇ) ence numberÛ¿°dONLNdˇˇ)8..°dONLNdˇˇ(ÕlưdONLNdˇˇ)csCode°dONLNdˇˇ)QPtr.°dONLNdˇˇ)8T∫¿°dONLNdˇˇ)ype of status call..°dONLNdˇˇ(Ÿl¨°dONLNdˇˇ)csParam°dONLNdˇˇ)QARRAY[1..10] OF Integer.°dONLNdˇˇ+8 Status information.
  4632. °dONLNdÌ* c(
  4633. * DESCRIPTION
  4634. .°dONLNd˘lÅ+BThe °dONLNd˝Å±)PBStatus°dONLNd±fl)0  function rR`°dONLNdfl›).6eturns information about the device driver having the ˇˇÜɰdONLNdFl)p(&lrR`°dONLNdGp)Ç)efer$¿°dONLNdKÇ)ÿ)ence number specifi1Δ°dONLNd^ÿ))V
  4635. ed by the ˇˇ
  4636. ≈O°dONLNdh);)-    ioCRefNumˇˇÜÉ≈O°dONLNdq;)D)6 fiK“°dONLNdtE)—)
  4637. eld. The value you pass in the ˇˇ
  4638. ˘g°dONLNdì—)ı)åcsCodeˇˇÜɢg°dONLNdôı)˜)$ °dONLNdö*l5s(2lfi°dONLNdú*s5È)eld and the information rR`°dONLNdµ*È5.)veceived in the R`°dONLNdƒ).5X)EcsParamR`°dONLNdÀ*X5b)* fiR`°dONLNdŒ*b5Û)
  4639. eld depend on the driver being .°dONLNdÌ6lAÆ(>lcalled. For mor, °dONLNd¸6ØA-)Ce information, see the specifiL‡°dONLNd6-Aú)~c chapters for the standar`°dONLNd46ùA«)p
  4640. d drivers.
  4641. °dONLNd?]*eL(c*SPECIALU°dONLNdF]MeÅ)#
  4642.  CONSIDERAÁ°dONLNdP]Äeö)3TIONS
  4643. .°dONLNdVklvÅ(slThe °dONLNdZjÅv±)PBStatus°dONLNdbk±vB)0 function does not move memoryd@°dONLNdÄkAvq)ê    . However¶‡°dONLNdâkpv≈)/, you should be sury@°dONLNdúk≈v‡)Ue the .°dONLNd¢wlÇ#(l'device driver does not move memory in r…@°dONLNd…w#Ç|)∑esponse to a status r¢@°dONLNdfiw|Ç≤)Y equest befor¥¿°dONLNdÍw≤ÇÒ)6e you call this °dONLNd˙Élé∂(ãlfunction at interrg†°dONLNd É∑éfl)K    upt time.
  4644. °dONLNd™*≤P(∞*ASSEMBL‹è°dONLNd™P≤T)&Yö∫°dONLNd™U≤≤)-LANGUAGE INFORMA—U°dONLNd/™≤≤«)]TION
  4645. ˇˇ“Ÿ.°dONLNd4∏l√≠(¿l
  4646. The trap macr¯°dONLNdA∏≠√◊)A
  4647. o for the ˇˇ•≤pù°dONLNdK∑ÿ√)+PBStatusˇˇ“Ÿpù°dONLNdS∏√<)0
  4648.  function is ˇˇ•≤È(°dONLNd`∑<√f)4_Statusˇˇ“ŸÈ(°dONLNdg∏f√˜)*! ($A005). Set bit 10 of the trap .°dONLNdàƒlœ}(ÃlworİdONLNdãƒ~œÃ)d to execute this r"İdONLNdûƒÃœ
  4649. )Noutine asynchrâ°dONLNd¨ƒ
  4650. œ0)AonouslyÂ@°dONLNd≥ƒ/œ…)"%. Set bit 9 to execute it immediatelyÀ °dONLNdÿƒ»œ )ô..°dONLNd⁄÷l·s(filYï°dONLNd€÷r·∂)ou must setup rg`°dONLNdÍ÷∂·ÿ)Degister     °dONLNdÚ÷ÿ·+)"A0 with the addr€`°dONLNd÷*·…)R!ess of the parameter block. When €`°dONLNd#’…·Û)ü_Status€`°dONLNd*÷Û·ˆ)* .°dONLNd+‚lÌo(ÍlrE°dONLNd,‚pÌï)    eturns, r °dONLNd5‚ïÌˇ)%egister D0 contains the rÍ¿°dONLNdN‚ˇÌö)j%esult code. Register D0 is the only r\İdONLNds‚õÌ√)ú
  4651. egister afİdONLNd}‚√ÌÌ)(
  4652. fected by °dONLNdáÓl˘Ç(ˆlthis r˛ °dONLNdçÓǢ†)outine.
  4653.     °dONLNdï˝l∫(lRegisters on entry
  4654. °dONLNd® lx*A0°dONLNd´ ®Ω)<addr|İdONLNdØ Ω0)ess of the parameter block
  4655.     °dONLNd l&¥(#lRegisters on exit
  4656. °dONLNd‹*l5x*D0°dONLNdfl*®5´)<rE°dONLNd‡*¨5ÿ)
  4657. esult code
  4658. °dONLNdÎQ*YD(W*RESULèU°dONLNdQDYh)T CODES
  4659. .°dONLNd¯^ljä+(noErr.°dONLNd˛_¯j˝)å0°dONLNd_j-)No errE†°dONLNd_.j7)or.°dONLNd    ilu¢(rl    statusErr°dONLNdjÓu˝)Ç–18.°dONLNdjuL)#Driver can’t rã°dONLNd%jLu≠);espond to this status r≤@°dONLNd<j≠u…)aequest.°dONLNdCtlÄ®(}l
  4660. badUnitErr.°dONLNdNuÓÄ˝)Ç–21°dONLNdRuÄ()#Refer⁄ °dONLNdWu(Ä”)&ence number out of range or not in use.°dONLNd~lã¥(àl unitEmptyErr.°dONLNdãÄÓã˝)Ç–22°dONLNdèÄãÅ)#DCE points to null driver.°dONLNd©älñ®(ìl
  4661. notOpenErr.°dONLNd¥ãÓñ˝)Ç–26°dONLNd∏ãñ\)#Driver isn’t open.°dONLNd ïl°ú(ûlabortErr.°dONLNd”ñÓ°˝)Ç–27°dONLNd◊ñ°2)#Status rÕ†°dONLNdflñ2°û)!equest aborted by KillIOˇ>@ˇ ˇˇˇˇ@
  4662. ˇ·ˇ‚7^
  4663. 4H\, Palatino
  4664. .+ä"CHAPTER œ´)\1,     Helvetica
  4665.     (@äThe Device Manager4⁄ä˙(‡äReference to the Device Manager
  4666. ~¿(‡1
  4667. ‡)-a¿)35
  4668. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4669. 1/91(¯ä Second line.4^H¿
  4670. °dONLNd]Heo(cHSEE ALSO
  4671. °dONLNd    läw1+B&For information about the high-level r°dONLNd/l2w¯)®.outine for monitoring device drivers, see the .°dONLNd]xäÉî(ÄäprR`°dONLNd_xîÉ9)
  4672. $evious section, which describes the ,
  4673. CourierR`°dONLNdÉw9É])•StatusR`°dONLNdâx]Éá)$
  4674.  function.
  4675. ≥Hª4¥Hª ¥H¥
  4676. ˇ·ˇ‚7^
  4677. .°dONLNdï¶H≥k(∞HKillIOˇˇˇˇˇˇ(∞1
  4678. ˇˇ1ä.°dONLNdúΔä—ë(ŒäYï°dONLNdùΔê—œ)ou can use the ˇ˛c[(°dONLNd¨≈–—Ù)@KillIOˇˇ1ä[(°dONLNd≤ΔÙ—w)$ function to terminate all curr%:°dONLNd—Δx—)Ñ"ent and pending I/O with a device .°dONLNdۓ䛕(⁄ädriver‡°dONLNd˘“•›ß)..°dONLNd˚ÈäıÄ(Úä)FUNCTION KillIO (refNum: Integer): OSErr;°dONLNd%ä
  4679. Æ*refNum.°dONLNd,Ã
  4680. 
  4681. )BContains the rπ`°dONLNd:
  4682. 
  4683. )>efereİdONLNd>
  4684. µ)"ence number identifying the driverô¿°dONLNd`µ
  4685. ∑)ö.
  4686. °dONLNdb(H0Å(.H DESCRIPTION
  4687. .°dONLNdn7äBü+BThe °dONLNdr6üB√)KillIO°dONLNdx7√B,)$ function stops any currR`°dONLNdê7,BU)i    ent I/O r$¿°dONLNdô7UBô))equest being pr˜ °dONLNd®7òB˝)Cocessed by the driver ˇˇQ°dONLNdæCäN◊(Käindicated by the ˇ˛>¢›Û°dONLNdœB◊N)MioRefNumˇˇQ›Û°dONLNd◊CN)0 fi˝D°dONLNd⁄CN8)        eld and rF°dONLNd„C9N©))emoves all pending I/O r]ͰdONLNd˚C©N”)p
  4688. equests frOõ°dONLNdC”N¯)*om the r`ù°dONLNd
  4689. C¯N)%equest .°dONLNdOäZÊ(Wäqueue for that driverˆ°dONLNd)OÂZ¶)[+. The Device Manager calls the completion rÖ†°dONLNdTOßZ)¬outine for each pending ˇˇM.°dONLNdl[äf°(cäI/O ri≠°dONLNdq[°fÍ)equest with the ˇ˛.öØî°dONLNdÅZÍf)IioResultˇˇMØî°dONLNdâ[f#)0 fiΔ·°dONLNdå[#f[)    
  4690. eld of each rfl(°dONLNdô[[fµ)8equest equal to the rº°dONLNdÆ[∂f‰)[ esult code ˇ˛.ö=V°dONLNdπZ‰f).abortErrˇˇMˆ°dONLNd¡[f)/.ˇˇ¢Ÿ°dONLNd√mäx (uäThe Device Manager passes ˇˇE≤ d°dONLNd›l x0)ÇKillIOˇˇ¢Ÿ d°dONLNd„m0x6)$ rÄù°dONLNdÂm6x)3equests to a driver only if the driver is open and .°dONLNdyäÑ’(Åäenabled for contr͇°dONLNd)y’Ñı)K    ol calls.
  4691. ëHû4íHù
  4692. °dONLNdˇˇ(ôäIMPORT °dONLNdˇˇ)ANT
  4693. ˇ·ˇ‚7^
  4694. °dONLNd3úäßé(§ä;The KillIO function terminates all pending I/O for a driverI°dONLNdnúéßø(§é , including °dONLNdz®ä≥%(∞ä$I/O initiated by other applications.,
  4695.  
  4696. Zapf Dingbats
  4697. é`°dONLNdˇˇ)ûs°dONLNd≥œH◊j(’HSPECIALU°dONLNd∫œk◊ü)#
  4698.  CONSIDERAÁ°dONLNdƒœû◊∏)3TIONS
  4699. .°dONLNd ›äËü(ÂäThe °dONLNdŒ‹üË√)KillIO°dONLNd‘›√ËT)$ function does not move memoryd@°dONLNdÚ›SËÉ)ê    . However¶‡°dONLNd˚›ÇË◊)/, you should be sury@°dONLNd›◊Ë)U
  4700. e the device .°dONLNdÈäÙ"(Òä driver does not move memory in rõ`°dONLNd;È"Ùi)òesponse to this r'†°dONLNdLÈjÙ†)H equest befor: °dONLNdXȆÙ)6e you call this function at °dONLNdtıä¢(˝äinterr°dONLNdzı£À)    upt time.
  4701. °dONLNdÑH$b("HRESULèU°dONLNdâb$Ü)T CODES
  4702. .°dONLNdë)ä5®+(noErr.°dONLNdó*5)å0°dONLNdô*/5K)No errE†°dONLNdü*L5U)or.°dONLNd¢4ä@¿(=ä    statusErr.°dONLNd¨5 @)Ç–18°dONLNd∞5/@j)#Driver can’t rã°dONLNdæ5j@À);espond to this status r≤@°dONLNd’5À@Á)aequest.°dONLNd‹?äKΔ(Hä
  4703. badUnitErr.°dONLNdÁ@ K)Ç–21°dONLNdÎ@/KF)#Refer⁄ °dONLNd@FKÒ)&ence number out of range or not in use.°dONLNdJäV“(Sä unitEmptyErr.°dONLNd$K V)Ç–22°dONLNd(K/Vü)#DCE points to null driver.°dONLNdBUäaΔ(^ä
  4704. notOpenErr.°dONLNdMV a)Ç–26°dONLNdQV/az)#Driver isn’t open
  4705. °dONLNdc|HÑo(ÇHSEE ALSO
  4706. °dONLNdlääï.+B%For information about the low-level rƆ°dONLNdëä.ïæ)§ outine for terminating pending rã`°dONLNd±äæï¯)êequests for a .°dONLNdøñä°ß(ûädriver¬†°dONLNd≈ñ¶°k),, see the next section, which describes the ¬†°dONLNdÒïk°õ)≈PBKillIO¬†°dONLNd˘ñõ°≈)0
  4707.  function.ˇ@ˇ ˇˇˇˇ@
  4708. ˇ·ˇ‚7^
  4709. 4*\˜, Palatino
  4710. .+l"CHAPTER œ´)\1,     Helvetica
  4711.     (@lThe Device Manager4⁄*˙¯
  4712. (‡*1 )-c)36
  4713.     )9Reference to the Device Manager
  4714. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4715. 1/91(¯l Second line.4^*¿¯
  4716. j*q¯4j*q¯ j*j˛
  4717. ˇ·ˇ‚7^
  4718. °dONLNd\*i](f*PBKillIOˇˇˇˇˇˇ(fÚ1
  4719. .°dONLNd    |lás(ÑlYï°dONLNd
  4720. |ráµ)ou can use the ,
  4721. Courierï°dONLNd{µáÂ)CPBKillIOï°dONLNd!|Âám)0 function to terminate all currg`°dONLNd@|má)àent and pending I/O with a .°dONLNd[àlì¶(êl
  4722. device driverI¿°dONLNdhà¶ì®):..°dONLNdjül´¢(®l    FUNCTION °dONLNdsü¢´Ã)6PBKillI°dONLNdzüôh)*O (paramBlock: ParmBlkPtr;°dONLNdù≠ΔπÃ(∂Δ °dONLNdü≠ÿπfi) °dONLNd†≠fiπn)async: Boolean) : OSErr;°dONLNdπ≈l—®(Œl
  4723. paramBlock.°dONLNdƒΔÆ—h)B*Contains a pointer to the parameter block..°dONLNdÔ’l·ä(filasync.°dONLNdı÷Æ·À)BSpecifi‡°dONLNd¸÷À·x)&es to the Device Manager whether the rRİdONLNd"÷y·ƒ)Æequest is asynchrŒ‡°dONLNd3÷ƒ·‰)Konous. °¿°dONLNd:÷‰·Í) Yb@°dONLNd;÷Í·˜)ou .°dONLNd>‚ÆÌZ(ÍÆ$should always set this parameter to °dONLNdb·ZÌx)¨FALSE°dONLNdg‚xÌ{)..°dONLNdiÙlˇr(¸lY@İdONLNdjÙrˇÿ)ou specify values and rP°dONLNdÅÙÿˇ˘)feceive r¿°dONLNdâÙ˘ˇ⁄)!1eturn values in a Device Manager parameter block.
  4724.  *¯4
  4725. *¯
  4726.     °dONLNdˇˇ(lParameter block
  4727. ˇ·ˇ‚7^,    Symbol
  4728. °dONLNdˇˇ*Æ.°dONLNdˇˇ) ioCompletion°dONLNdˇˇ)QProcPtr.°dONLNdˇˇ)8Pointer to completion r쇰dONLNdˇˇ)foutine°dONLNdˇˇ(.l¨.°dONLNdˇˇ)ioResult°dONLNdˇˇ)QOSErr.°dONLNdˇˇ)8 Result code°dONLNdˇˇ(:lÆ.°dONLNdˇˇ)    ioCRefNum°dONLNdˇˇ)QInteger.°dONLNdˇˇ)8Driver rø¿°dONLNdˇˇ)#eferk‡°dONLNdˇˇ) ence number
  4729. °dONLNd`Y*ac(_* DESCRIPTION
  4730. .°dONLNdlglrÅ+BThe °dONLNdpfÅr±)PBKillIO°dONLNdxg±r)0 function stops any currR`°dONLNdêgr/)ient r$¿°dONLNdïg/rs)equest being pr˜ °dONLNd§grr◊)Cocessed by the driver ˇˇ¿‚°dONLNd∫sl~ª({lindicated by the ˇˇÅƒ¬¶°dONLNdÀrª~Ò)O    ioCRefNumˇˇ¿‚¬¶°dONLNd‘sÒ~˙)6 fiÉà°dONLNd◊s˚~$)
  4731.     eld and r◊¨°dONLNd‡s$~É))emoves all pending rÏ≤°dONLNdÙsÉ~≠)_
  4732. equests frÙ°dONLNd˛sÆ~Ì)+
  4733. om the driverø°dONLNd sÓ~˜)@’s .°dONLNdläo(álrE°dONLNdpäl)7equest queue. The Device Manager calls the completion rOİdONLNdFläÿ)¸outine for each pending .°dONLNd^ãlñp(ìlrR`°dONLNd_ãpñº)equest with the R`°dONLNdoäºñÏ)LioResultR`°dONLNdwãÏñˆ)0 fiR`°dONLNdzãˆñ1)
  4734.  
  4735. eld of each r$¿°dONLNdáã1ñè);equest equal to the r˜ °dONLNdúãéñæ)] esult code ˜ °dONLNdßäæñÓ)0abortErr9¿°dONLNdØãÓñÙ)0. °dONLNd≤öl•/(¢l'The Device Manager always executes the °dONLNdŸô/•_)√PBKillIO°dONLNd·ö_•f)0 rR`°dONLNd„öf•¯) outine immediately; that is, it ˇˇœ©°dONLNd¶l±∞(Ælnever places a ˇˇüRÓ˚°dONLNd•∞±‡)DPBKillIOˇˇœ©Ó˚°dONLNd¶‡±Ê)0 rë°dONLNd¶Á±7)equest in a driverΩ_°dONLNd.¶8±E)Q’s r_h°dONLNd2¶F±≠)equest queue. HoweverAZ°dONLNdG¶≠±¯)g, you should not °dONLNdX≤lΩõ(∫l call this rR`°dONLNdc≤õΩM)/#outine immediately—always call the R`°dONLNdܱMΩ})≤PBKillIOR`°dONLNdé≤}ΩÑ)0 r$¿°dONLNdê≤ÑΩ¡)
  4736. outine synchr˜ °dONLNdù≤¿Ω‚)<onously€`°dONLNd§≤·Ω‰)!.ˇ˛¢⁄°dONLNd¶ƒlœ(Ãl$Note that the Device Manager passes ˇ˝E¥Q°dONLNd √œG)´PBKillIOˇ˛¢⁄Q°dONLNd“ƒGœL)0 rΔV°dONLNd‘ƒLœ˜)*equests to a driver only if the driver is .°dONLNd˛–l€„(ÿlopen and enabled for contr͆°dONLNd–„€)w    ol calls.
  4737. È*ı¯4È*ı¯
  4738. °dONLNdˇˇ(lIMPORT °dONLNdˇˇ)ANT
  4739. ˇ·ˇ‚7^
  4740. ˇˇ}Ê.°dONLNd"ÙlˇÄ(¸lThe ˇ˛˚Ã˝Ê°dONLNd&Ûġ∞)PBKillIOˇˇ}Ê˝Ê°dONLNd.Ù∞ˇG)0" function terminates all pending rEƒ°dONLNdPÙHˇü)òequests for a driver°dONLNddÙüˇ§)W, .°dONLNdfl ú(l including rC °dONLNdqù G)1(equests initiated by other applications.,
  4741.  
  4742. Zapf Dingbats
  4743. ˜¿°dONLNdˇˇ)∞s°dONLNdØ&*.L(,*SPECIALU°dONLNd∂&M.Å)#
  4744.  CONSIDERAÁ°dONLNd¿&Ä.ö)3TIONS
  4745. .°dONLNdΔ5l@Å(=lThe °dONLNd 4Å@±)PBKillIO°dONLNd“5±@B)0 function does not move memoryd@°dONLNd5A@q)ê    . However¶‡°dONLNd˘5p@≈)/, you should be sury@°dONLNd 5≈@‡)Ue the .°dONLNdAlL#(Il'device driver does not move memory in r…@°dONLNd9A#Lj)∑esponse to this rUİdONLNdJAkL°)H equest beforh°dONLNdVA°L‡)6e you call this °dONLNdfMlX∂(Ulfunction at interrg†°dONLNdxM∑Xfl)K    upt time.
  4746. °dONLNdÇs*{P(y*ASSEMBL‹è°dONLNdâsP{T)&Yö∫°dONLNdäsU{≤)-LANGUAGE INFORMA—U°dONLNdõs≤{«)]TION
  4747. ˇˇQj.°dONLNd†Çlç¨(äl
  4748. The trap macrı4°dONLNd≠Ǩç‘)@
  4749. o for the ˇ˛¢‘Èr°dONLNd∑Å’ç))PBKillIOˇˇQjÈr°dONLNdøÇç7)0
  4750.  function is ˇ˛¢‘›∞°dONLNdÃÅ8çb)3_KillIOˇˇQj›∞°dONLNd”Çbçé)*
  4751.  ($A006). R‰°dONLNd›Çèçñ)-Yg‰°dONLNdfiÇïç÷)ou must setup r.ǰdONLNdÌÇ◊ç¯)Begister °dONLNdıélôø(ñlA0 with the addrR`°dONLNdéøô^)S!ess of the parameter block. When R`°dONLNd&ç^ôà)ü_KillIOR`°dONLNd-éàôè)* r$¿°dONLNd/éèô¥)    eturns, r˜ °dONLNd8é≥ôÂ)$ egister D0 .°dONLNdCöl•ß(¢lcontains the r†°dONLNdQö®•C)<%esult code. Register D0 is the only rÑ`°dONLNdvöC•k)õ
  4752. egister afß`°dONLNdÄök•¨)(fected by this rÒ¿°dONLNdêö¨• )Aoutine.ˇ(@ˇ ˇˇˇˇ@
  4753. ˇ·ˇ‚7^
  4754. 4H\, Palatino
  4755. .+ä"CHAPTER œ´)\1,     Helvetica
  4756.     (@äThe Device Manager4⁄ä˙(‡äSummary of the Device Manager
  4757. ~¿(‡1
  4758. ‡)-a¿)37
  4759. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4760. 1/91(¯ä Second line.4^H¿
  4761.     °dONLNd\ägÿ(däRegisters on entry
  4762. °dONLNdkävñ*A0°dONLNdkΔv€)<addr|İdONLNdk€vN)ess of the parameter block
  4763.     °dONLNd5zäÖ“(ÇäRegisters on exit
  4764. °dONLNdGâäîñ*D0°dONLNdJâΔî…)<rE°dONLNdKâ îˆ)
  4765. esult code
  4766. °dONLNdVØH∑b(µHRESULèU°dONLNd[Øb∑Ü)T CODES,
  4767. Courier
  4768. .°dONLNdcΩä…®+(noErr°dONLNdiæ…)å0.°dONLNdkæ/…K)No errE†°dONLNdqæL…U)or.°dONLNdt»ä‘¿(—ä    statusErr.°dONLNd~… ‘)Ç–18°dONLNdÇ…/‘j)#Driver can’t rã°dONLNdê…j‘À);espond to this status r≤@°dONLNdß…À‘Á)aequest.°dONLNdÆ”äflΔ(‹ä
  4769. badUnitErr.°dONLNdπ‘ fl)Ç–21°dONLNdΩ‘/flF)#Refer⁄ °dONLNd¬‘FflÒ)&ence number out of range or not in use.°dONLNdÈfiäÍ“(Áä unitEmptyErr.°dONLNdˆfl Í)Ç–22°dONLNd˙fl/Íü)#DCE points to null driver.°dONLNdÈäıΔ(Úä
  4770. notOpenErr.°dONLNdÍ ı)Ç–26°dONLNd#Í/ız)#Driver isn’t open
  4771. °dONLNd5Ho(HSEE ALSO
  4772. °dONLNd>ä)1+B&For information about the high-level r°dONLNdd2)¬)® outine for terminating pending r¿°dONLNdÑ¡)˚)èequests for a .°dONLNdí*ä5ß(2ädriver¬†°dONLNdò*¶5⁄) , see the prï°dONLNd§*⁄5)4$evious section, which describes the ï°dONLNd»)5£)•KillIOï°dONLNdŒ*£5Õ)$
  4773.  function.
  4774. IHd4JHd
  4775. uH}4vH} vHv
  4776. ˇ·ˇ‚7^
  4777. ˇˇ£‰.ˇÆ°dONLNdŸbHtD(pHSummary of the Device Managerˇˇˇˇˇˇ⁄|(p 1
  4778. °dONLNd˜Üäëˆ(éäThis section lists the defi‹†°dONLNd܈ël)lnitions and declarations prXİdONLNd-ÜmëÕ)wovided in this chapterU†°dONLNdCÜÕë“)`. (°dONLNdEÜ“ëÿ)YËİdONLNdFÜ◊ë¸)ou can fi≥İdONLNdOÜ˝ë )&nd °dONLNdRíäùÌ(öäLadvanced Device Manager information in the “Summary” section of the chapter °dONLNdûûä©ô* “W¬†°dONLNd†ûò©≤)riting {@°dONLNdßû≥©π)Y;¿°dONLNd®ûπ©!)our Own Device Driverº°dONLNdΩû ©`)g,” in this book.
  4779. ÿHfi4ŸHfi ⁄H⁄
  4780. ˇ·ˇ‚7^
  4781. °dONLNdŒÀHÿ}(’H    Constants
  4782. .°dONLNdÿ‰Hf*CONST°dONLNdflÚT˛Δ+ {Positioning modes}°dONLNdÙT ä*    fsAtMark °dONLNd˝ä ñ)6  °dONLNdˇñ ∫)  = 0; °dONLNd Ü)r{at current position}°dONLNd%HN(H °dONLNd&NT) °dONLNd'T®)fsFromStart = °dONLNd5®∫)T1; °dONLNdCí)`{offset from beginning}°dONLNd[H(N(%H °dONLNd\N(T) °dONLNd]T(ú) fsFromMark  °dONLNdiú(∫)H= 2; °dONLNdy(º)l{offset from current position}°dONLNdô4T@ú(=T {Read modes}°dONLNdßBTNä*    rdVerify °dONLNd∞BäNñ)6  °dONLNd≤BñN∫) = 64; °dONLNd¬BNt)r{read-verify mode}ˇÄ@ˇ ˇˇˇˇ@
  4783. ˇ·ˇ‚7^
  4784. 4*\˜, Palatino
  4785. .+l"CHAPTER œ´)\1,     Helvetica
  4786.     (@lThe Device Manager4⁄*˙¯
  4787. (‡*1 )-c)38
  4788.     )9Summary of the Device Manager
  4789. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4790. 1/91(¯l Second line.4^*¿¯
  4791. j*o¯4j*o¯ k*k˛
  4792. ˇ·ˇ‚7^
  4793. °dONLNd\*iM(f*Data T˘@°dONLNd\Lid)"ypes,
  4794. Courier
  4795. .°dONLNd u6ŧ(~6=ParamBlkType = {ioParam, fileParam, volumeParam, cntrlParam};°dONLNdLë6ùñ*ParamBlockRec = °dONLNd^ü6´Z*RECORD°dONLNdg≠Hπl+qLink:°dONLNdr≠¢πÿ)Z    QElemPtr;°dONLNd≠ÍπV)H{next queue entry}°dONLNdîªH«l(ƒHqType:°dONLNdüª¢«“)ZInteger;°dONLNd´ªÍ«2)H {queue type}°dONLNd∫…H’r(“HioTrap:°dONLNdΔ…¢’“)ZInteger;°dONLNd“…Í’>)H{routine trap}°dONLNd„◊H„Ñ(‡H
  4796. ioCmdAddr:°dONLNdÚ◊¢„∫)ZPtr;°dONLNd˙◊Í„P)H{routine address}°dONLNdÂHÒñ(ÓH
  4797. ioCompletion:°dONLNd Â¢Ò“)ZProcPtr;°dONLNd,ÂÍÒb)H{completion routine}°dONLNdCÛHˇ~(¸H    ioResult:°dONLNdQÛ¢ˇΔ)ZOSErr;°dONLNd[Û͡8)H
  4798. {result code}°dONLNdkH
  4799. Ñ(
  4800. H
  4801. ioNamePtr:°dONLNdz¢
  4802. fi)Z
  4803. StringPtr;°dONLNdàÍ
  4804. 8)H
  4805. {driver name}°dONLNdòH~(H    ioVRefNum°dONLNd¢~Ñ)6:°dONLNdߢ“)$Integer;°dONLNd≥Í∂)H"{volume reference or drive number}°dONLNdÿH)¿(&HCASE ParamBlkType OF°dONLNd+Z7ä+ioParam:°dONLNd¸9ZE`* °dONLNd˛9lE®)
  4806. (ioRefNum:°dONLNd 9¥EÍ)H     Integer;°dONLNd9E§)Z{driver reference number}°dONLNd8GlSÆ(Pl  ioVersNum:°dONLNdGG¥S¸)H  SignedByte;°dONLNdXGSJ)Z
  4807. {not used}°dONLNdgUlaÆ(^l  ioPermssn:°dONLNdvU¥a¸)H  SignedByte;°dONLNdáUaò)Z{read/write permission}°dONLNd£cloú(ll ioMisc:°dONLNdØc¥o“)H Ptr;°dONLNdπcoJ)Z
  4808. {not used}°dONLNd»ql}®(zl
  4809.  ioBuffer:°dONLNd÷q¥}“)H Ptr;°dONLNd‡q}û)Z{pointer to data buffer}°dONLNd˝lã¥(àl  ioReqCount:°dONLNd
  4810. ¥ãÍ)H     LongInt;°dONLNdã∞)Z{requested number of bytes}°dONLNd;çlô¥(ñl  ioActCount:°dONLNdKç¥ôÍ)H     LongInt;°dONLNdYçôû)Z{actual number of bytes}°dONLNdvõl߯(§l  ioPosMode:°dONLNdÖõ¥ßÍ)H     Integer;°dONLNdìõßz)Z{positioning mode}°dONLNd™©lµ∫(≤l
  4811.  ioPosOffset:°dONLNdª©∫µ¿)N °dONLNdº©¿µˆ)    LongInt);°dONLNd ©µÜ)N{positioning offset}°dONLNd‚∑Z√ú(¿Z cntrlParam:°dONLNd≈H—N(ŒH °dONLNdÛ≈l—Æ)$ (ioCRefNum:°dONLNd≈¥—Í)H     Integer;°dONLNd≈—§)Z{driver reference number}°dONLNd.”lflú(‹l csCode:°dONLNd:”¥fl¸)H  SignedByte;°dONLNdK”flt)Z{type of request}°dONLNda·lÌ¢(Íl     csParam:°dONLNdn·¥ÌP)H ARRAY[1..10] OF Integer);°dONLNdûÔ˚û+Z{control or status info}°dONLNd∫˝Z    r(ZEND;°dONLNd¡ H`(HEND;
  4812. H*N¯4I*N¯ J*J˛
  4813. ˇ·ˇ‚7^
  4814. .°dONLNdΔ;*HY(E*Routines
  4815. °dONLNdœ^*j‰*""Opening and Closing Device Drivers
  4816. .°dONLNdÚq*}ú*FUNCTION OpenDriver°dONLNdq‘}()™(name: Str255;°dONLNd‘ãÇ* VAR refNum: Integer): OSErr;°dONLNd=õ*ßÑ(§*FUNCTION PBOpen°dONLNdTõ‘ßd)™(paramBlock: ParmBlkPtr;°dONLNdn©‘µd* async: Boolean): OSErr;ˇ
  4817. B@ˇ ˇˇˇˇ@
  4818. ˇ·ˇ‚7^
  4819. 4H\, Palatino
  4820. .+ä"CHAPTER œ´)\1,     Helvetica
  4821.     (@äThe Device Manager4⁄ä˙(‡äSummary of the Device Manager
  4822. ~¿(‡1
  4823. ‡)-a¿)39
  4824. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4825. 1/91(¯ä Second line.4^H¿,
  4826. Courier
  4827. .°dONLNdjHvÆ(sHFUNCTION OpenSlot°dONLNdjÚvÇ)™(paramBlock: ParmBlkPtr;°dONLNd1xÚÑÇ* async: Boolean): OSErr;°dONLNdJîH†¿(ùHFUNCTION CloseDriver°dONLNdhîÚ†à)™(refNum: Integer): OSErr;°dONLNdÇ∞Hº®(πHFUNCTION PBClose°dONLNdö∞ÚºÇ)™(paramBlock: ParmBlkPtr;°dONLNd¥æÚ Ç* async: Boolean): OSErr;
  4828. .°dONLNdÕ‹HË≤(ÂHReading From and Wwß°dONLNdfl‹≤Ë◊)jriting T{ö°dONLNdÁ‹◊Ë*)%o Device Drivers
  4829. .°dONLNd¯ÔH˚¢(¯HFUNCTION FSRead°dONLNdÔÚ˚X)™(refNum: Integer;°dONLNd!˝Ú    j* VAR count: LongInt;°dONLNd7 Úv* buffPtr: Ptr): OSErr;°dONLNdN'H3¢(0HFUNCTION PBRead°dONLNdb'Ú3Ç)™(paramBlock: ParmBlkPtr;°dONLNd{5¯AÇ+async: Boolean): OSErr;°dONLNdìQH]®(ZHFUNCTION FSWrite°dONLNd§QÚ]X)™(refNum: Integer:°dONLNdæ_¯kj+VAR count: LongInt;°dONLNd⁄m¯yv*buffPtr: Ptr): OSErr;°dONLNdâHï~(íH    FUNCTION °dONLNd˘â~ï®)6PBWrite°dONLNdâÚïÇ)t(paramBlock: ParmBlkPtr;°dONLNd"ó¯£Ç+async: Boolean): OSErr;
  4830. .°dONLNd:µH¡#(æH)Controlling and Monitoring Device Drivers
  4831. .°dONLNdd»H‘®*FUNCTION Control°dONLNd}»Ú‘X)™(refNum: Integer;°dONLNdò÷¯‚X+csCode: Integer;°dONLNd≤‰¯à*csParamPtr: Ptr): OSErr;°dONLNdÀH ~(    H    FUNCTION °dONLNd‘~ ¥)6    PBControl°dONLNdfiÚ Ç)t(paramBlock: ParmBlkPtr;°dONLNdˇ¯Ç+async: Boolean): OSErr;°dONLNd*H6¢(3HFUNCTION Status°dONLNd/*Ú6X)™(refNum: Integer;°dONLNdI8¯DX+csCode: Integer;°dONLNdaF¯Rà*csParamPtr: Ptr): OSErr;°dONLNdzbHnÆ(kHFUNCTION PBStatus°dONLNdåbÚnÇ)™(paramBlock: ParmBlkPtr;°dONLNd≠p¯|Ç+async: Boolean): OSErr;°dONLNd≈åHò®(ïHFUNCTION KillIO °dONLNd›åÚòà)™(refNum: Integer): OSErr;ˇ
  4832. N@ˇ ˇˇˇˇ@
  4833. ˇ·ˇ‚7^
  4834. 4*\˜, Palatino
  4835. .+l"CHAPTER œ´)\1,     Helvetica
  4836.     (@lThe Device Manager4⁄*˙¯
  4837. (‡*1 )-c)40
  4838.     )9Summary of the Device Manager
  4839. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4840. 1/91(¯l Second line.4^*¿¯,
  4841. Courier
  4842. .°dONLNd\*h`(e*    FUNCTION °dONLNd    \`hê)6PBKillIO°dONLNd\‘hd)t(paramBlock: ParmBlkPtr;°dONLNd3j⁄vd+async: Boolean): OSErr;
  4843. ß*≠¯4®*≠¯ ©*©˛
  4844. ˇ·ˇ‚7^
  4845. .°dONLNdKö*ßo(§* Result Codes
  4846. .°dONLNdX±*ΩH*noErr.°dONLNd^≤áΩå)]0°dONLNd`≤üΩΩ)No Erró¿°dONLNdf≤ΩΩΔ)or.°dONLNdiΩ*…f(Δ*
  4847. controlErr.°dONLNdtæ}…å)S–17°dONLNdxæü…⁄)"Driver can’t rã°dONLNdÜæ⁄…1);espond to this contr%‡°dONLNdöæ2…@)Xol r»¿°dONLNdûæ@…\)equest.°dONLNd•…*’`(“*    statusErr.°dONLNdØ }’å)S–18°dONLNd≥ ü’⁄)"Driver can’t rã°dONLNd¡ ⁄’;);espond to this status r≤@°dONLNdÿ ;’W)aequest.°dONLNdfl’*·T(fi*readErr.°dONLNdÁ÷}·å)S–19°dONLNdÎ÷ü·⁄)"Driver can’t rã°dONLNd˘÷⁄· ); espond to rs@°dONLNd÷ ·")2ead rù†°dONLNd    ÷"·B)equests.°dONLNd·*ÌT(Í*writErr.°dONLNd‚}Ìå)S–20°dONLNd‚üÌ⁄)"Driver can’t rã°dONLNd+‚⁄Ì%);espond to write r1@°dONLNd<‚&ÌF)Lequests.°dONLNdDÌ*˘f(ˆ*
  4848. badUnitErr.°dONLNdOÓ}˘å)S–21°dONLNdSÓü˘∂)"Bad r¸Ä°dONLNdXÓ∂˘Δ)efer®†°dONLNd\Ó«˘) ence number.°dONLNdh˘*r(* unitEmptyErr.°dONLNdu˙}å)S–22°dONLNdy˙ü∂)"Bad r¸Ä°dONLNd~˙∂Δ)efer®†°dONLNdÇ˙«) ence number.°dONLNdé*T(*openErr.°dONLNdñ}å)S–23°dONLNdöü)"Driver can’t perform rY`°dONLNd∞/)b
  4849. equested r6†°dONLNd∫/|).eading or writing.°dONLNdÃ*Z(*dInstErr.°dONLNd’}å)S–26°dONLNdŸüŒ)"
  4850. Couldn’t fiİdONLNd‰œ
  4851. )0nd driver in rƒ†°dONLNdÚ
  4852. ");esour ‡°dONLNd˜#4)ce fi”İdONLNd¸4;)le.°dONLNdˇ*)`(&*    dRemovErr.°dONLNd    })å)S–26°dONLNd
  4853. ü)’)" Attempt to r+°dONLNd÷)7)7emove an open driver.°dONLNd.)*5f(2*
  4854. notOpenErr.°dONLNd9*}5å)S–26°dONLNd=*ü5Í)"Driver isn’t open.°dONLNdO5*AZ(>*abortErr.°dONLNdX6}Aå)S–27°dONLNd\6üA)"Request aborted by KillIO.°dONLNdvA*MH(J*ioErr°dONLNd|B}Må)S–36.°dONLNdÄBüM)"Data doesn’t match in r…@°dONLNdóBMO)gead-verify modeˇ@@ˇ ˇˇˇˇ@
  4855. ˇ·ˇ‚7^
  4856. 4H\, Palatino
  4857. .+ä"CHAPTER œ´)\1,     Helvetica
  4858.     (@äThe Device Manager4⁄ä˙(‡äSummary of the Device Manager
  4859. ~¿(‡1
  4860. ‡)-a¿)41
  4861. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4862. 1/91(¯ä Second line.4^H¿
  4863. jHo4jHo kHk
  4864. ˇ·ˇ‚7^
  4865. °dONLNd\Hi¯(fHAssembly-Language Information
  4866. °dONLNdHãÔ*"Device Manager Parameter Block
  4867. °dONLNd>çmòr+%
  4868. 0,
  4869. Courier.°dONLNd@åäò®)qLink.°dONLNdFçfiòâ)T%used internally by the Device Manager°dONLNdnôm§r(°m4.°dONLNdpòä§®)qType.°dONLNdvôfi§â)T%used internally by the Device Manager°dONLNdû•m∞r(≠m6.°dONLNd†§ä∞Æ)ioTrap.°dONLNdß•fi∞â)T%used internally by the Device Manager°dONLNdœ±mºr(πm8.°dONLNd—∞亿)    ioCmdAddr.°dONLNd€±fiºâ)T%used internally by the Device Manager,    Symbol°dONLNdˇˇ(≈HưdONLNdˇˇ)%12.°dONLNdˇˇ) ioCompletion.°dONLNdˇˇ)T completion r§Ä°dONLNdˇˇ)8outine°dONLNdˇˇ(—H¨°dONLNdˇˇ)%16.°dONLNdˇˇ)ioResult.°dONLNdˇˇ)TrE°dONLNdˇˇ)
  4870. esult code°dONLNdˇˇ(›HưdONLNdˇˇ)%18.°dONLNdˇˇ)    ioNamePtr.°dONLNdˇˇ)T driver name°dONLNdˇˇ(ÈHưdONLNdˇˇ)%22.°dONLNdˇˇ)    ioVRefNum.°dONLNdˇˇ)T drive number°dONLNdˇˇ(HưdONLNdˇˇ)%24.°dONLNdˇˇ)ioRefNum.°dONLNdˇˇ)Tdriver r@°dONLNdˇˇ)"efer `°dONLNdˇˇ) ence number°dONLNdˇˇ(
  4871. m26.°dONLNdˇˇ)    ioVersNum.°dONLNdˇˇ)Tnot used°dONLNdˇˇ(HưdONLNdˇˇ)%28.°dONLNdˇˇ)    ioPermssn.°dONLNdˇˇ)TrE°dONLNdˇˇ)ead/write permission°dONLNdˇˇ(%m30.°dONLNdˇˇ)ioMisc.°dONLNdˇˇ)Tnot used°dONLNdˇˇ(1HưdONLNdˇˇ)%32.°dONLNdˇˇ)ioBuffer.°dONLNdˇˇ)Tpointer to data buf˚°dONLNdˇˇ)Rfer°dONLNdˇˇ(=HưdONLNdˇˇ)%36.°dONLNdˇˇ)
  4872. ioReqCount.°dONLNdˇˇ)TrE°dONLNdˇˇ)equested number of bytes°dONLNdˇˇ(IH¨°dONLNdˇˇ)%40.°dONLNdˇˇ)
  4873. ioActCount.°dONLNdˇˇ)Tactual number of bytes°dONLNdˇˇ(UHưdONLNdˇˇ)%44.°dONLNdˇˇ)    ioPosMode.°dONLNdˇˇ)Tpositioning mode°dONLNdˇˇ(aH´°dONLNdˇˇ)%46.°dONLNdˇˇ) ioPosOffset.°dONLNdˇˇ)Tpositioning ofÛ@°dONLNdˇˇ)=fset°dONLNdˇˇ(yHưdONLNdˇˇ)%24.°dONLNdˇˇ)    ioCRefNum.°dONLNdˇˇ)Tdriver r@°dONLNdˇˇ)"efer `°dONLNdˇˇ) ence number°dONLNdˇˇ(ÖHưdONLNdˇˇ)%26.°dONLNdˇˇ)csCode.°dONLNdˇˇ)T
  4874. type of contr• °dONLNdˇˇ)8ol or status r∂°dONLNdˇˇ)7equest°dONLNdˇˇ(ëH´°dONLNdˇˇ)%28.°dONLNdˇˇ)csParam.°dONLNdˇˇ)Tcontr>İdONLNdˇˇ)ol or status information°dONLNdˇˇ(©m28.°dONLNdˇˇ)ioMix.°dONLNdˇˇ)TrE°dONLNdˇˇ)eserved for use by slot driverÁ‡°dONLNdˇˇ)Å    ’s open r√¿°dONLNdˇˇ)&outine°dONLNdˇˇ(µHưdONLNdˇˇ)%32.°dONLNdˇˇ)ioFlags.°dONLNdˇˇ)T!determines number of additional fi8¿°dONLNdˇˇ)õeldsCİdONLNdˇˇ)
  4875.  for OpenSlot°dONLNdˇˇ(ÕHưdONLNdˇˇ)%34.°dONLNdˇˇ)ioSlot.°dONLNdˇˇ)T slot number°dONLNdˇˇ(ŸHưdONLNdˇˇ)%35.°dONLNdˇˇ)ioId.°dONLNdˇˇ)Tslot r¢@°dONLNdˇˇ)esourÍİdONLNdˇˇ)ce ID°dONLNdˇˇ(ÒHưdONLNdˇˇ)%34.°dONLNdˇˇ)
  4876. ioSEBlkPtr.°dONLNdˇˇ)T#pointer to external parameter block
  4877. °dONLNdˇˇ(*HT†À°dONLNdˇˇ)
  4878. rap Macros
  4879.     °dONLNdˇˇ(@HTÄ–°dONLNdˇˇ)    rap Macro°dONLNdˇˇ)uTÄ–°dONLNdˇˇ)rap WV¿°dONLNdˇˇ)ord
  4880. °dONLNdˇˇ(OH_Open°dONLNdˇˇ)z$A000°dONLNdˇˇ(_H_Close°dONLNdˇˇ)z$A001°dONLNdˇˇ(oH_Read°dONLNdˇˇ)z$A002°dONLNdˇˇ(H_W¬†°dONLNdˇˇ)rite°dONLNdˇˇ)l$A003°dONLNdˇˇ(èH_ContrÂ@°dONLNdˇˇ)ol°dONLNdˇˇ)\$A004°dONLNdˇˇ(üH_Status°dONLNdˇˇ)z$A005°dONLNdˇˇ(ØH_KillIO°dONLNdˇˇ)z$A006ˇ»@ˇ ˇˇˇˇ@
  4881. ˇ·ˇ‚7^
  4882. 4*\˜, Palatino
  4883. .+l"CHAPTER œ´)\1,     Helvetica
  4884.     (@lThe Device Manager4⁄*˙¯
  4885. (‡*1 )-c)42
  4886.     )9Summary of the Device Manager
  4887. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4888. 1/91(¯l Second line.4^*¿¯ˇ@@ˇ ˇˇˇˇ@
  4889. ˇ·ˇ‚7^
  4890. 4⁄∫˙,     Helvetica
  4891.     .(‡∫Contents
  4892. 
  4893. ‡(‡2ù)-‡)1
  4894. (Ô∫Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4895. 1/91(¯∫ Second line., Palatino
  4896.         (#∫CHAPTER )~2
  4897. ˇˇf|ˇÆ°dONLNd[∫z’(t∫WÆ\°dONLNd[’z)riting EİdONLNd[z,)EYÌ|°dONLNd    [*zû)our Own 
  4898. ûHM4ûHM 5H5
  4899. °dONLNdˇˇ(G∫Contents
  4900. ˇ·ˇ‚7^
  4901. ˇˇf|ˇÆ°dONLNd{∫öe(î∫
  4902. Device Driver
  4903. °dONLNd ]∫hƒ*—W¬†°dONLNd!]√h#)    riting a Device DriverÛ°dONLNd9]7hD)t2-3°dONLNd=jƒuA(rƒHow the Device Manager Wq†°dONLNdUjAuT)}orks•‡°dONLNd[jhuu)'2-3°dONLNd_wƒÇœ(ƒCr\°dONLNdawœÇ2) eating a Driver Resour!‡°dONLNdww3Ç<)dce[¿°dONLNd{wPÇ])2-5°dONLNdуè_(僠Responding to the Device ManagerX‡°dONLNd°ÑtèÜ)∞2-10°dONLNd¶ëŒú5(ôŒEntering and Exiting Fr-‡°dONLNdΩë6ú{)hom Driver Subr†°dONLNdÀë{úõ)EoutinesÖ°dONLNd‘ëØú¡)42-10°dONLNdŸûŒ©ÿ(¶ŒW¬†°dONLNd⁄û◊©`)    riting the Open and Close Subr˚`°dONLNd¯û`©Ä)âoutinesz¿°dONLNdûï©¢)52-1B°dONLNdû¢©ß)
  4904. 1°dONLNd´Œ∂ÿ(≥ŒW¬†°dONLNd´◊∂4)    riting the Prime Subrú°dONLNd´4∂P)]outinefi`°dONLNd$´d∂v)02-14°dONLNd)∏Œ√ÿ(¿ŒW¬†°dONLNd*∏◊√)    riting the ContrkİdONLNd:∏√l)Eol and Status Subr“†°dONLNdL∏l√å)PoutinesR°dONLNdU∏°√≥)52-15°dONLNdZ≈ƒ–(Õƒ
  4905. Handling I/O €°dONLNdg≈–))@AsynchrF`°dONLNdn≈*–M)&onouslyæ`°dONLNdw≈a–s)72-18°dONLNd|“ƒ›(⁄ƒInstalling the Driver!°dONLNdì“2›D)n2-19°dONLNdòfl∫̓(Á∫W¬†°dONLNdôfl√Í
  4906. )    riting a Chooser«‡°dONLNd©fl
  4907. ÍÅ)G-Compatible Device Driver,‡°dONLNdƒflñÍ®)å2-22°dONLNd…σ˜(ÙƒHow the Chooser W‹‡°dONLNd⁄Ϙ0)Yorks °dONLNd‡ÏE˜W)(2-22°dONLNd¢ƒœ(ƒCr\°dONLNdÁ˘œY) eating a Chooser Extension File5°dONLNd˘nÄ)ü2-25°dONLNd
  4908. ƒœ(ƒCr\°dONLNdœ9) eating a Device Package‚°dONLNd(M_)~2-27°dONLNd-ƒ<(ƒResponding to the Chooserƒ °dONLNdHPb)å2-29°dONLNdM ƒ+6((ƒAllocating private storageX†°dONLNdi K+])á2-32°dONLNdn-∫8ƒ(5∫W¬†°dONLNdo-√8˛)    riting a Desk ùİdONLNd}-˛8*);    AccessoryÄ °dONLNdà-?8Q)A2-33°dONLNdç:ƒEı(Bƒ    How Desk íİdONLNdñ:ıE4)1
  4909. Accessories Wj°dONLNd£:4EB)?orka@°dONLNd®:WEi)#2-33°dONLNd≠GƒRœ(OƒCr\°dONLNdØGœR2) eating a Driver Resour!‡°dONLNd≈G3Rn)dce for a Desk  `°dONLNd”GnRö);    AccessoryÔ°dONLNdfiGÆR¿)@2-34°dONLNd„Tƒ_E(\ƒOpening and Closing a Desk û`°dONLNd˛TE_q)Å    AccessoryŰdONLNd    TÜ_ò)A2-34°dONLNdaƒl$(iƒResponding to EventsvİdONLNd$a9lK)u2-35°dONLNd)n∫y—(v∫Refer⁄ °dONLNd.n—y‰)enceذdONLNd4n˘y )(2-36°dONLNd9{ƒÜÁ(ɃData Str``°dONLNdA{Ëܡ)$ucturÊ@°dONLNdF{ˇÜ)esχ°dONLNdJ{Ü.)2-36°dONLNdOàŒìH(êŒThe Extended Device Contrì@°dONLNdhàHìk)zol Entry"`°dONLNdràÄìí)82-37°dONLNdwÎ(ùƒRoutines≠`°dONLNdÅïˇ†);2-38°dONLNdÜ¢ƒ≠„(™ƒResourv@°dONLNd墄≠)cesÌ °dONLNdë¢≠)!2-41°dONLNdñØ∫∫Â(∑∫Summary†°dONLNdüØ˘∫ )?2-43ˇå@ˇ ˇˇˇˇ@
  4910. ˇ·ˇ‚7^
  4911. 4*\˜, Palatino
  4912. .+ú"CHAPTER œ´)\24⁄*˙¯,     Helvetica
  4913. (‡*2 )-c)2
  4914.     )iContents
  4915. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4916. 1/91(¯ú Second line.4^*¿¯ˇ~@ˇ ˇˇˇˇ@
  4917. ˇ·ˇ‚7^, Palatino
  4918. .+ä"CHAPTER 
  4919. 4⁄ä˙,     Helvetica
  4920.     (‡äW’ê)riting a Device Driver
  4921. 
  4922. ‡(‡2ù)-‡)3
  4923. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4924. 1/91(¯ä Second line.("È2
  4925.     ˇˇ—ÚˇÆ°dONLNd8äCí(@äWßǰdONLNd8íC¶)riting ;@°dONLNd8ßC¨)Y:r°dONLNd    8¨C)our Own Device Driverˇˇˇˇˇˇ≠>(@2
  4926. °dONLNd]ähk(eä3This chapter describes how to write a device driver≥@°dONLNdR]kh)·%, how your device driver can use the °dONLNdwiätÆ(qäChooserè@°dONLNd~iÆt≥)$:, and how to make your device driver into a desk accessory' °dONLNd∏i≥tµ(q≥.°dONLNd∫{äÜ(ÉäUAlthough this chapter describes some of the internal mechanisms of the Device Manager≤†°dONLNd{Ü(É, °dONLNdáäí„(èäyou do not need to r#İdONLNd%á‰íÂ)Z:ead this chapter if you want to use the Device Manager to °dONLNd_ìäû¯(õäcommunicate with an alrú¿°dONLNdvì¯ûp)neady-existing device driverQ¿°dONLNdëìpûÛ)x. See the chapter “The Device °dONLNdØü䙀(ßäManager” instead.°dONLNd¡±äºZ*.If you do want to write your own device driverñ°dONLNdÔ±Zº˘)–%, or just learn about how the Device °dONLNdΩä»q(≈ä3Manager interacts with device drivers, you should fi¯‡°dONLNdHΩq»Ç)Árst r؇°dONLNdMΩÉ»)ead the chapter “The Device °dONLNdi…ä‘Ê(—äManager” and then rÚ‡°dONLNd|…Ê‘,)\ead this chapterñ`°dONLNdå…,‘.)F.°dONLNdé€äÊ(„äThis chapter shows how you can,
  4927.  
  4928. Zapf Dingbats
  4929. °dONLNd≠Ôäˆè*n
  4930. °dONLNdØÌñ¯û) crµ@°dONLNd±Ìû¯)eate a device driver that r- °dONLNdÃ̯ê)qesponds to Device Manager r3¿°dONLNdÁÌê¯∞)Åequests
  4931. °dONLNdÔäè(än
  4932. °dONLNdÒˇñ
  4933. ü) prG °dONLNdÛˇ†
  4934. ë)
  4935. 7ovide a user interface for your driver with the Chooser
  4936. °dONLNd+äè(än
  4937. °dONLNd-ñû) crµ@°dONLNd/û˚)eate a desk accessory°dONLNdE#ä.ê(+äY@İdONLNdF#ê.¬) ou should r@°dONLNdQ#√.Î)3    ead the fi‡¿°dONLNd[#Î.Y)(rst section of this chapter¬¿°dONLNdv#Y.)n', which describes how to write a basic °dONLNdù/ä:ƒ(7ä
  4938. device driverI¿°dONLNd™/ƒ:‡):, befor)`°dONLNd±/‡:Î)e r8°dONLNd¥/Î:›) 7eading the sections on the Chooser or desk accessories.
  4939. ?HZ4@HZ
  4940. kHs4lHs lHl
  4941. ˇ·ˇ‚7^
  4942. ˇˇ£‰ˇÆ°dONLNdÏXHjX(fHWœ°dONLNdÌXXj˜)riting a Device Driverˇˇˇˇˇˇ⁄|(f 2
  4943. °dONLNd|äáŒ(ÑäHThis section shows you how to write a basic device driver—one that can rI°dONLNdL|œá˝(Ñœ
  4944. espond to °dONLNdVàäìÿ(êäDevice Manager r&`°dONLNdfàŸì˛)O    equests. ˆ°dONLNdoà˛ì)%Y© °dONLNdpàì6) ou should ry‡°dONLNd{à7ìî)3ead this section befor‡Ä°dONLNdëàîìü)]e rÔ °dONLNdîàüìø) eading ù`°dONLNdõà¿ìœ)!“W‡°dONLNdùàŒì)    riting a °dONLNd¶îäüÆ(úäChooser°dONLNd≠îØü[)%%-Compatible Device Driver” on page 2-˘†°dONLNd“î[üe)¨21˘†°dONLNd‘îeüs)
  4945.  or a¿°dONLNdÿîtüÉ)“W§`°dONLNd⁄îÇüΩ)riting a Desk @°dONLNdËîΩüˇ);Accessory” on °dONLNdˆ†ä´™(®äpage 2-Æ¿°dONLNd˝†™´¥) 31Æ¿°dONLNdˇ†¥´π)
  4946. . °dONLNd≤äΩê(∫äTµ¿°dONLNd≤èΩÚ)o write a device driver≥°dONLNd≤ÚΩI)c, you need to know 
  4947. °dONLNd.ΔäÕè(Ãän
  4948. °dONLNd0ƒñœò) 8how the Device Manager opens drivers, maintains data str≈İdONLNdhƒòœØ(ÃòucturK`°dONLNdmƒ∞œ)es about them, and °dONLNdÄ–ñ€(ÿñcommunicates with them
  4949. °dONLNdó‰äÎè(Íän
  4950. °dONLNdô‚ñÌø)     how to cr °dONLNd¢‚¿Ì˝)*eate a driver r~‡°dONLNd±‚˝Ì)=esour« °dONLNd∂‚Ì)ce
  4951. °dONLNdπˆä˝è(¸än
  4952. °dONLNdªÙñˇ) how the code in your driver rú¿°dONLNdÿÙˇ0)Çesour°dONLNd›Ù0ˇ`) ce should rs°dONLNdËÙaˇ›)1espond to Device Manager r<†°dONLNdÙfiˇ˛)}equests°dONLNd
  4953. äI(ä+The next few sections examine these topics.
  4954. 6H<47H< 7ä7
  4955. ˇ·ˇ‚7^
  4956. ˇˇ◊ˇ◊°dONLNd6&ä6O*$How the Device Manager Wfi°dONLNdN&N6k)ƒorksˇˇˇˇˇˇ•)¿2
  4957. °dONLNdS=äH‘(EäGThe Device Manager communicates with device drivers by calling one of fi√İdONLNdõ=‘H‡(E‘ve ≥`°dONLNdû=·Hˇ)
  4958. driver °dONLNd•IäT¿(Qä subroutinesͰdONLNd∞I¿T)6: Open, Prime, ContrJİdONLNdƒITz)\ol, Status, and Close. ;@°dONLNd€IzT)^All drivers must have an Open °dONLNd˘Uä`Ã(]äand Close subry`°dONLNdUÃ`6)Boutine; the Prime, Contr†°dONLNdU7`â)kol, and Status subr°dONLNd2Uà`≥)Q
  4959. outines ar©`°dONLNd<U¥`‚), e optional.°dONLNdHgär”(oäEach driver subr«`°dONLNdXg”rˇ)I outine is rÙ °dONLNdcgˇr˚),8esponsible for handling certain types of Device Manager °dONLNdõsä~ç({ärE°dONLNdúsé~≥)    equests. ˇ#\@ˇ ˇˇˇˇ@
  4960. ˇ·ˇ‚7^
  4961. 4*\˜, Palatino
  4962. .+l"CHAPTER œ´)\2,     Helvetica
  4963.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  4964. (‡*2 )-c)4
  4965.     )9W’ê)riting a Device Driver
  4966. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  4967. 1/91(¯l Second line.4^*¿¯
  4968.     °dONLNd\lg÷(dlDevice Manager routines°dONLNd\¸g})êResponsible driver subroutine,
  4969. Courier
  4970. ˇ˝ˇ¸.°dONLNd7jlv®(sl
  4971. OpenDriverˇ˛ˇ˛¬†°dONLNdAkßv´);, ˇ˝ˇ¸¬û°dONLNdCj¨v–)PBOpenˇ˛ˇ˛¬û°dONLNdIk–v‘)$, ˇ˝ˇ¸¬ú°dONLNdKj’v)OpenSlot.°dONLNdUk&v>)QOpenˇ˝ˇ¸.°dONLNdZzlÜê(ÉlFSReadˇ˛ˇ˛°dONLNd`{êÜî)$, ˇ˝ˇ¸˛°dONLNdbzïÜπ)PBRead.°dONLNdj{&Ü@)ëPrime.°dONLNdpälñÃ(ìlFSWrite, PBWrite.°dONLNdÇã&ñ@)∫Primeˇ˝ˇ¸.°dONLNdàöl¶ê(£lStatusˇ˛ˇ˛°dONLNdéõê¶î)$, ˇ˝ˇ¸˛°dONLNdêöï¶≈)PBStatus.°dONLNdöõ&¶A)ëStatusˇ˝ˇ¸.°dONLNd°™l∂ñ(≥lControlˇ˛ˇ˛°dONLNd®´ñ∂ö)*, ˇ˝ˇ¸˛°dONLNd™™õ∂—)    PBControl.°dONLNdµ´&∂?)ãContrÂ@°dONLNd∫´?∂G)olˇ˝ˇ¸.°dONLNdΩ∫lΔê(√lKillIOˇ˛ˇ˛°dONLNd√ªêΔî)$, ˇ˝ˇ¸˛°dONLNd≈∫ïΔ≈)PBKillIO.°dONLNdœª&Δ?)ëContrÂ@°dONLNd‘ª?ΔG)olˇ˝ˇ¸.°dONLNdÿ l÷Æ(”l CloseDriverˇ˛ˇ˛¬†°dONLNd„À≠÷±)A, ˇ˝ˇ¸¬û°dONLNd ≤÷‹)PBClose.°dONLNdÓÀ&÷>)tClose
  4972. „*¯4‰*Ô¯
  4973. °dONLNdˇˇ(ÎlNOTE
  4974. ˇ·ˇ‚7^
  4975. °dONLNdÙÓl˘Œ* The Device Manager rb °dONLNdÓŒ˘˘)b
  4976. outines ar&İdONLNdÓ˙˘í),$e listed by their actual names. The °dONLNd6˙l}(lcorr`°dONLNd:˙~‡)esponding driver subrª†°dONLNdO˙‡&)boutine names aro°dONLNd^˙'É)Ge descriptive names. ¡`°dONLNds˙Éâ)\YҰdONLNdt˙âñ)ou °dONLNdwl1(l,can choose any name for your actual driver r? °dONLNd£2ç)Δoutines—the Device °dONLNd∂lÛ(lManager locates them using of@°dONLNd”Ù')à fsets you pr∞°dONLNdfl'B)3ovide.,
  4977.  
  4978. Zapf Dingbats
  4979. İdONLNdˇˇ)"u
  4980. ˇˇ’U.°dONLNd˚*l5Y(2l1When an application or another manager calls the ˇˇ™™*®°dONLNd,)Z5ñ)Ó
  4981. OpenDriverˇˇ’U*®°dONLNd6*ñ5¯)< function, the Device .°dONLNdL6lA®(>l Manager sear]†°dONLNdX6®Aá)<6ches the unit table to see if a driver with the specifi>¿°dONLNdè6àA≈)‡ed name is alr‡°dONLNdù6≈A‹)=eady °dONLNd¢BlM›(JlQopen. If no open driver has a matching name, the Device Manager opens the driver °dONLNdÛNlYo* rE°dONLNdÙNpYà)esourç@°dONLNd˘NàY◊)ce with the specifi¿°dONLNd N◊Y)O
  4982. ed name. TÔ‡°dONLNdNYT)0o open a driver frÍ °dONLNd(NTYp)Mom a r¯†°dONLNd.NpYà)esour@‡°dONLNd3NâYÔ)ce, the Device Manager
  4983. °dONLNdJbliq(hln
  4984. °dONLNdL`xkfi) loads the driver code frQ@°dONLNdd`flk)gom the r= °dONLNdl`k)%esourÖ`°dONLNdq`ka)ce into memory
  4985. °dONLNdÄtl{q(zln
  4986. °dONLNdÇrx}Ä) crµ@°dONLNdÑrÄ}÷)eates a device contr¥@°dONLNdòr÷})Vol entry for it, fi‰¿°dONLNd´r}Ç)Elling it in with values frk@°dONLNd≈rÉ}‡)hom the header of the °dONLNd⁄~xâô(Üxdriver r@°dONLNd‚~öâ≤)"esourfİdONLNdÁ~≤âΩ)ce,
  4987. °dONLNdÎílôq(òln
  4988. °dONLNdÌêxõ‡) installs the device contrꆰdONLNdê‡õˆ)hBol entry in the unit table at a location determined by the driver °dONLNdHúxß{(§xrE°dONLNdIú|ßî)esourç@°dONLNdNúîß™)ce ID
  4989. °dONLNdT∞l∑q(∂ln
  4990. °dONLNdVÆxππ) calls the driverÚ°dONLNdfÆ∫πÚ)B ’s Open subr°dONLNdrÆÛπ)9outine.°dONLNdz¿lÀ›(»lThe header of the driver rÛ¿°dONLNdî¿›Àı)qesour<°dONLNdô¿ˆÀÍ)7ce contains information about the driver such as which °dONLNd–Ãl◊ù(‘l driver subrͰdONLNd€Ãù◊»)1
  4991. outines arÆ`°dONLNdÂÃ…◊8),e implemented and wher£`°dONLNd˚Ã8◊c)o
  4992. e the subr€ °dONLNdÃc◊é)+
  4993. outines arüİdONLNdÃè◊™),e. See º °dONLNdÙ◊∫)“Crò °dONLNdÃ∫◊fl)    eating a °dONLNd"ÿl„™(‡l
  4994. Driver ResourÒ°dONLNd/ÿ™„Ë)>ce” on page 2-†Ä°dONLNd=ÿÈ„Ó)?5†Ä°dONLNd>ÿÓ„à)$ for the format of the driver headerA‡°dONLNdbÿà„ä)ö..°dONLNddÍlı¢(Úl Unlike the °dONLNdoÈ¢ıfi)6
  4995. OpenDriver°dONLNdyÍfiı)< function, the °dONLNdàÈıB)@PBOpen°dONLNdéÍBıY)$ and °dONLNdìÈYıâ)OpenSlot°dONLNdõÍâıÍ)0 functions expect the .°dONLNd±ˆl≠(˛ldriver to be alr¿°dONLNd¡ˆÆJ)B$eady installed. These functions searÿ°dONLNdˆJŒ)ú ch the unit table for the driver°dONLNdˆ–Ÿ)Ü’s °dONLNdl
  4996. ¢(
  4997. l device contrl`°dONLNd¢
  4998. )6ol entry and call the driverÀİdONLNd0
  4999. P)v ’s Open subrŸÄ°dONLNd<P
  5000. n)8outine..°dONLNdDlÆ(lIf you use the °dONLNdSÆ“)BPBOpen°dONLNdY“·)$ or °dONLNd]·)OpenSlot°dONLNdeì)0 function to open your driver¬†°dONLNdÇíµ)Å, you arï°dONLNd䵡)#e rg`°dONLNdç¡Û) esponsible .°dONLNdò l+É((lfor crÒ@°dONLNdû É+Á)eating the device contr‡°dONLNdµ Ë+ˆ)eBol entry and installing it in the unit table. Even if you use the .°dONLNd˜+l7®(4l
  5001. OpenDriver°dONLNd,®74)<  function to install your driver¬†°dONLNd!,37V)ã, you arï°dONLNd),V7b)#e rg`°dONLNd,,b7®) esponsible for f7‡°dONLNd<,®7ˆ)Finding an empty .°dONLNdL8lC    (@l$space in the unit table, which may r⇰dONLNdp8    C )ùequir° °dONLNdu8 Cg)e allocating morª°dONLNdÖ8gCÂ)Ge memory for it. The section °dONLNd¢DlO(Ll"“Installing the Driver” on page 2-ñ†°dONLNdƒDO
  5002. )î18ñ†°dONLNdΔD
  5003. O~)
  5004.  discusses the device contrİdONLNd·DO°)uol entry:¿°dONLNdÈD†O˜)!, the unit table, and °dONLNdˇPl[±(Xlhow you can pr≤`°dONLNd
  5005. P±[ )Eoperly install your driverҰdONLNd'P [")o.°dONLNd)blmr(jlTµ¿°dONLNd*bqm∂)o allow asynchrl†°dONLNd9b∑mÿ)Fonous r≤ °dONLNd@bÿm∞)!0equests, the Device Manager maintains a driver rE‡°dONLNdpb±mÌ)Ÿ
  5006. equest queue °dONLNd}nly≈(vlfor each open driveru¿°dONLNdën≈y )Y. `°dONLNdìn y—)AR°dONLNdîn—yı)     driver rp@°dONLNdùnıyd)$equest queue is a standar¥†°dONLNd∂ndyÍ)od Operating System queue, as °dONLNd”zlÖu(Çl=described in the chapter “Operating System Utilities” in the P¿°dONLNd    zvÖÌ(ÇvInside Macintosh: Operating °dONLNd    ,Ülëâ(élSystemÒİdONLNd    2Üâë≤)     volume. .°dONLNd    <òl£[(†l1When an application or another manager calls the °dONLNd    mó[£)ÔPBRead°dONLNd    sò£Ö)$, °dONLNd    uóÖ£Ø)PBWrite°dONLNd    |òØ£µ)*, °dONLNd    ~óµ£Â)PBStatus°dONLNd    Üò£˜)0, or °dONLNd    ã£lØ¢(¨l    PBControl°dONLNd    î§¢Ø©)6 rR`°dONLNd    ñ§©ØÏ)Doutine, the Device Manager places the parameter block at end of the .°dONLNd    ⁄∞lªá(∏ldriverñ†°dONLNd    ‡∞àªï)’s rfl‡°dONLNd    ‰∞ïªf)
  5007. 0equest queue. The high-level versions of these r†°dONLNd
  5008. ∞gªí)“
  5009. outines cr¥@°dONLNd
  5010. ∞íª›)+eate a parameter ˇ'Ú@ˇ ˇˇˇˇ@
  5011. ˇ·ˇ‚7^
  5012. 4H\, Palatino
  5013. .+ä"CHAPTER œ´)\2,     Helvetica
  5014.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5015. 
  5016. ‡(‡2ù)-‡)5
  5017. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5018. 1/91(¯ä Second line.4^H¿
  5019. °dONLNd]äh≠(eäblock (fiEİdONLNd    ]Æh€)$ lling the fiI@°dONLNd]€h©)-0elds with the values of the parameters sent to r¨‡°dONLNdE]©hfi)Œ outine wher&@°dONLNdP]flh )6 e possible °dONLNd[iät(qä"and using default values for the r`°dONLNd}it~)ìest) and add it to the r¶Ä°dONLNdïi~tΩ)aequest queue. µ†°dONLNd£iΩt’)?As pr°dONLNd®i÷t˛)    eviously-°dONLNd±uäı(}äqueued r`°dONLNdπu≤Äfi)(
  5020. equests arP@°dONLNd√ufiIJ),e satisfiK`°dONLNdÃuˇÄß)!$ed, the parameter block moves forwarR`°dONLNdußÄœ)®
  5021. d in the rJ@°dONLNd˙uœÄ)(equest queue. °dONLNdÅäåu(âä5When the parameter block is at the beginning of the r§‡°dONLNd=Åuå)Î!equest queue, the Device Manager °dONLNd^çäò≈(ïäcalls the appr§†°dONLNdlç≈ò);opriate driver subrÌ@°dONLNdçò)S:outine and passes it a pointer to the parameter block and °dONLNdπôä§Î(°äa pointer to the driver[‡°dONLNd–ôϧ+)b’s device contrÃİdONLNdflô+§M)?ol entryÌ¿°dONLNdÁôL§N)!.°dONLNdÈ´ä∂ü(≥äFor rº@°dONLNdÓ´ü∂˙)eading and writing rŸ‡°dONLNd´˙∂“)[0equests, the Device Manager calls the Prime subrˆ‡°dONLNd2´“∂Û)ÿoutine, °dONLNd:∑䬬(øä
  5022. described in `°dONLNdG∑√¬“)9“WW°dONLNdI∑—¬.)riting the Prime Subr0`°dONLNd^∑.¬)]outine” on page 2-Ë`°dONLNdp∑¬â)Q13Ë`°dONLNdr∑â¬∑)
  5023. . This subr†°dONLNd}∑∏¬ )/outine can execute °dONLNdê√äŒß(Àäsynchr$ °dONLNdñ√®ŒÀ)onouslyÄ`°dONLNdù√ Œ)", completing the r‡°dONLNdØ√ŒF)N
  5024. equested r˘ °dONLNdπ√EŒ´)-eading or writing befor¨`°dONLNd–√¨Œ∑)ge rª°dONLNd”√∑Œˆ) eturning contrİdONLNd·√˜Œ
  5025. )@ol to °dONLNdÁœä⁄‚(◊äthe Device ManagerÅ`°dONLNd˘œ‚⁄)X , or asynchr
  5026. †°dONLNdœ⁄9)4onouslyi‡°dONLNd œ8⁄Ä)", beginning the r¿†°dONLNdœÄ⁄Ô)Hequested transaction but °dONLNd6€äÊç(„ärE°dONLNd7€éÊÕ)eturning contr£Ä°dONLNdE€ÕÊU)?ol to the Device Manager befor◊†°dONLNdc€UÊ·)à"e the completing it. If the driver»‡°dONLNdÖ€‚Ê)ç    ’s Prime °dONLNdéÁäÚç(ÔärE°dONLNdèÁéÚ)outine can execute asynchr,`°dONLNd©ÁÚ()wonouslyà†°dONLNd∞Á'Ú‚)"), the driver must use some mechanism to rİdONLNdŸÁ„Ú˝)ºegain °dONLNdflÛ䲆(˚äcontr>İdONLNd‰Û°˛—) ol of the prä@°dONLNdÛ—˛F)0ocessor and complete the r% °dONLNd
  5027. ÛG˛n)v    equest. T¿°dONLNdÛn˛Ÿ)'ypically these drivers pr‡°dONLNd,ÛŸ˛Ù)kovide °dONLNd2ˇä
  5028. ¢(äinterr°dONLNd8ˇ£
  5029. ı)upt handlers that rù‡°dONLNdKˇı
  5030. ;)Respond to interrX °dONLNd[ˇ<
  5031. Y)Gupts fry†°dONLNdbˇY
  5032. ï)
  5033. om the driver∑ °dONLNdoˇñ
  5034. ˇ)=’s device and notify the °dONLNdà ä|(ä5Device Manager when the transaction is complete. See †°dONLNdΩ }¬)Û“Handling I/O t†°dONLNdÀ ¬Á)EAsynchr‡°dONLNd“ Á)%    onously” °dONLNd€ä"∑(ä
  5035. on page 2-u†°dONLNdÂ∏"¬).17u†°dONLNdÁ¬"Â)
  5036.  for mor@ °dONLNdÔÊ" )$
  5037. e details.°dONLNd˙)ä4$(1ä The Device Manager handles contrâ °dONLNd)$4ã)öolling and monitoring rA°dONLNd1)å4)hequests in the same way as °dONLNdL5ä@ç(=ärE°dONLNdM5é@È)eading and writing rb†°dONLNda5È@g)[equests, except that for contr¿°dONLNd5h@à)olling rÁ‡°dONLNdá5á@Û)equests it calls the Contr√ °dONLNd°5Û@˝)lol °dONLNd§AäLù(Iäsubr¿°dONLNd®AûL)outine and for monitoring r∑‡°dONLNd√ALö)y equests it calls the Status subrG@°dONLNd„AõL)Ñoutine. The section °dONLNd˜MäXô(Uä“W¬†°dONLNd˘MòX‹)riting the ContrkİdONLNd    M›X-)Eol and Status Subr“†°dONLNdM-XÇ)Poutines” on page 2-«†°dONLNd.MÉXç)V15«†°dONLNd0MçXŸ)
  5038.  shows how to pr¸`°dONLNd@MŸX
  5039. )L ovide these °dONLNdLYädù(aäsubr¿°dONLNdPYûd)outines for your driverf`°dONLNdgYd)d.°dONLNdikävÏ(säThe Device Manager rb °dONLNd}kÏv@)besponds to KillIO r=°dONLNdêk@vt)T equests by r†°dONLNdúkuv)5emoving the parameter blocks fr¥°dONLNdªkv)èom ˇˇ⁄Ä.°dONLNdæwäÇ2(ä%the queue, calling their completion rñ‡°dONLNd„w2ÇÖ)®outines with the r¯¿°dONLNdıwÖÇ¥)S esult code ,
  5040. Courierˇˇµ≠¿°dONLNdvµÇÂ)0abortErrˇˇ⁄Ä`°dONLNdw‰Ç)/ , and then °dONLNdÉäé˝(ãäcalling the drivers ContrR`°dONLNd,É˝é)sol subr$¿°dONLNd3ÉéÜ)outine with a value of $¿°dONLNdJÇÜé∂)kkillCode$¿°dONLNdRÉ∂é‹)0     for the $¿°dONLNd[Ç‹é)&csCode$¿°dONLNdaÉé)$ .°dONLNdbèäö∑(óä    parameterS†°dONLNdkè∑öº)-. &°dONLNdmèºö¬)YÊİdONLNdnè¡öÊ)ou can fi±Ä°dONLNdwèÁöÜ)&#nd information on handling KillIO r @°dONLNdöèáöµ)† equests in ¥‡°dONLNd•èµöƒ).“W˜Ä°dONLNdßè√ö)riting the Contr†`°dONLNd∑èö)Eol °dONLNd∫õä¶œ(£äand Status Subr    @°dONLNd…õ–¶%)Foutines” on page 2-˛@°dONLNd‹õ%¶/)U15˛@°dONLNdfiõ/¶1)
  5041. .°dONLNd‡≠ä∏ô(µäIn rÙ‡°dONLNd‰≠ô∏˜)esponse to a closing r°dONLNd˙≠¯∏Ù)_7equest, the Device Manager queues the parameter block, °dONLNd1πäƒÙ(¡ämaking one if necessary≠†°dONLNdHπÛƒ7)i. Since closing r˙°dONLNdYπ7ƒ™)Dequests cannot be asynchr* °dONLNdrπ´ƒ¸)tonous, the Device °dONLNdÑ≈ä–(ÕäManager sends each queued ri`°dONLNdü≈–d)Ñequest to the driverÕ`°dONLNd≥≈c–ß)U. Since the last r䇰dONLNd≈≈®–)Eequest is the closing °dONLNd€—ä‹ç(ŸärE°dONLNd‹—é‹è):equest, the Device Manager ultimately calls the Close subr°dONLNd    —ꋸ(Ÿêoutine. When the driver °dONLNd    .›äËÁ(Âäindicates it has satisfia¿°dONLNd    F›ËË+)^ed the closing rΩİdONLNd    V›+˸)C.equest, the Device Manager unlocks the device °dONLNd    ÑÈäÙ†(Òäcontr>İdONLNd    âȰÙ)Sol entry and the driver code. Note that the Device Manager does not dispose of the °dONLNd    ‹ıä¿(˝ä device contrl`°dONLNd    Ëı¿ )6ol entry or even ra`°dONLNd    ˙ı ;)L emove it fr(°dONLNd
  5042. ı<å)0om the unit table. °dONLNd
  5043. äæ(ä The section $@°dONLNd
  5044. %øŒ)5“Wf‡°dONLNd
  5045. 'ÕV)riting the Open and Close Subrü†°dONLNd
  5046. EV´)âoutines” on page 2-dONLNd
  5047. X¨±)V1°dONLNd
  5048. Y±∂)1°dONLNd
  5049. Z∂) shows how your °dONLNd
  5050. jäΩ(ä driver can rfl‡°dONLNd
  5051. vΩa)3$espond to both opening and closing ru†°dONLNd
  5052. öbÖ)•equests.
  5053. CHI4DHI DäD
  5054. ˇ·ˇ‚7^
  5055. ˇˇ◊ˇ◊°dONLNd
  5056. £3äCö(?äCrîø°dONLNd
  5057. •3õC6)eating a Driver ResourÔ°dONLNd
  5058. ª37CE)úceˇˇˇˇˇˇ•)◊2
  5059. °dONLNd
  5060. æJäUê(RäY@İdONLNd
  5061. øJêUª)
  5062. ou will prî`°dONLNd
  5063. …JªU)+obably want to storÌ °dONLNd
  5064. ‹JUÅ)Ue your driver in a driver rÊ`°dONLNd
  5065. ˜JÅUô)qesour.†°dONLNd
  5066. ¸JöU˜)ce, although if you arŒ¿°dONLNd J˜U˛)]e °dONLNd VäaÄ(^ä9writing a driver for a slot device you might want to stor• °dONLNd MVÄa )ˆ!e your driver in the declaration °dONLNd nbäm˝(jäROM of the expansion carç °dONLNd Üb˝m)sd (see Õ°dONLNd çbm˘)4Designing Cards and Drivers for the Macintosh Family‡°dONLNd ¡b˙m )· for ˇˇEö.°dONLNd Δnäyõ(vämorR`°dONLNd …nõy\)-e details). Storing your driver in a driver rQê°dONLNd ˆn\ys)¡esour#°dONLNd ˚nsy±)ce allows the ˇ˛ã4Ùæ°dONLNd     m±yÌ)>
  5067. OpenDriverˇˇEöÙæ°dONLNd nÌy)<
  5068.  function .°dONLNd zäÖ¢(Çä?to load your driver code into memory and install a device contrí °dONLNd \z¢Ö (Ç¢ol entry for your driver °dONLNd uÜäë“(éäin the unit table.°dONLNd àò䣱*
  5069. Like all rr†°dONLNd íò±£…)'esour∫‡°dONLNd óò…£)ces, your driver rN`°dONLNd ©ò£-)Lesourñ†°dONLNd Æò-£U)
  5070. ce has a r#‡°dONLNd ∏òV£n))esourl °dONLNd Ωòn£ù) ce type, a r@°dONLNd …òû£∂)0esourPİdONLNd Œò∂£›)
  5071. ce ID, a rk °dONLNd ÿò›£ı)'esour≥`°dONLNd ›òı£)ce °dONLNd ‡§äØæ(¨ä name, and r! °dONLNd ΧøØ◊)5esouri`°dONLNd §◊Ø)ce attributes:ˇ‘@ˇ ˇˇˇˇ@
  5072. ˇ·ˇ‚7^
  5073. 4*\˜, Palatino
  5074. .+l"CHAPTER œ´)\2,     Helvetica
  5075.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5076. (‡*2 )-c)6
  5077.     )9W’ê)riting a Device Driver
  5078. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5079. 1/91(¯l Second line.4^*¿¯,
  5080.  
  5081. Zapf Dingbats
  5082. °dONLNd_lfq(eln
  5083. .°dONLNd]xhë) The rR`°dONLNd]ëh®)esour$¿°dONLNd ]®hÒ)ce type must be ,
  5084. Courier$¿°dONLNd\Òh)I'DRVR'$¿°dONLNd"]h)$.
  5085. .°dONLNd$qlxq(wln
  5086. °dONLNd&oxzè) The rÄ¿°dONLNd+oèzß)esour…°dONLNd0oßz )ce ID determines wherŒ°dONLNdEo z)d7e in the unit table the OpenSlot function installs the °dONLNd|{xÜì(Éxdriverñ†°dONLNdÇ{îÜ”)’s device contr@°dONLNdë{‘܈)@ol entry(İdONLNdô{ıÜ8)!. Unfortunatelyˇ¿°dONLNd®{7Üù)B, you must choose the r;†°dONLNdø{ûÜ∂)gesourɇ°dONLNdƒ{∂ÜÍ) ce ID when °dONLNdœáxíÄ(èxcrµ@°dONLNd—áÄí◊)eating your driver r¶¿°dONLNdÂá◊íÔ)WesourÔ°dONLNdÍáÔí⁄)2ce and you cannot know which unit numbers will be °dONLNdìxû(õx$available until you open your driverT‡°dONLNd@ìû1)†. Ther’†°dONLNdFì1ûB)efor-†°dONLNdJìCû)e, your driver°@°dONLNdXìû≠)<
  5087. -opening rdONLNdbì≠û‰). outine must °dONLNdnüx™~(ßxfiå¿°dONLNdpü~™p)7nd an empty location in the unit table and change the r燰dONLNdßüp™à)Úesour÷ °dONLNd¨üà™∏) ce ID accorF¿°dONLNd∑üπ™’)1dingly °dONLNdΩü’™Ì). The °dONLNd√´x∂ô(≥xsection ËİdONLNdÀ´ô∂-)!"“Installing the Driver” on page 2-ˇ °dONLNdÌ´-∂7)î18ˇ °dONLNdÔ´7∂z)
  5088.  discusses apprİdONLNd˛´{∂€)Dopriate values for the °dONLNd∑x¬{(øxrE°dONLNd∑|¬î)esourç@°dONLNd∑î¬≠)ce ID.
  5089. °dONLNd"Àl“q(—ln
  5090. ˇˇ¡œ.°dONLNd$…x‘ê) The r/°dONLNd)…ë‘®)esourÊè°dONLNd.…ß‘∏):ce name should be the same as the driver name so that the ˇˇÉûæ°dONLNdh»π‘ı(—π
  5091. OpenDriverˇˇ¡œæ°dONLNdr…ı‘˜)< .°dONLNds’x‡∑(›xfunction can fi‹†°dONLNdÇ’∑‡˜)?nd the driver rE`°dONLNdë’¯‡)Aesour熰dONLNdñ’‡)ce. i °dONLNdö’‡%)A£¿°dONLNdõ’%‡Ì)/ driver name consists of a period (.) followed °dONLNd ·xÏ¡(ÈxIby any sequence of 1 to 254 printing characters. The Device Manager ignorƆ°dONLNd·¡Ïˆ(È¡
  5092. es case (but °dONLNd Ìx¯E(ıx,not diacritical marks) when comparing names.
  5093. °dONLNdMlq(ln
  5094. °dONLNdPˇx
  5095. è) The rÄ¿°dONLNdUˇè
  5096. ß)esour…°dONLNdZˇß
  5097. $)ce attributes of your driver r†`°dONLNdxˇ$
  5098. <)}esourˆ°dONLNd}ˇ<
  5099. ¨)ce depend on your driver°‡°dONLNdïˇ¨
  5100. ±)p. CİdONLNdóˇ±
  5101. ∏)A~ °dONLNdòˇ∏
  5102. €)     typical °dONLNd° x‡(xTdriver might have these attributes: locked, since most drivers contain code that is °dONLNdıx"∏* called at interr¿°dONLNd∏"Ó)@Iupt time; in the system heap, so that the driver exists over launches of °dONLNdN#x.–(+xapplications; and pr® °dONLNdb#–.8)Xeloaded, which makes rQ‡°dONLNdx#9.Q)iesourö °dONLNd}#Q.∂)ce loading slightly morM °dONLNdî#∑.Δ)fe ef܆°dONLNdò#Δ.Ã)fiì`°dONLNdö#Ã.„)cient.°dONLNd°5l@s(=lA∫†°dONLNd¢5s@ó)     driver rÿ‡°dONLNd´5ó@Ø)$esour! °dONLNd∞5∞@˘)ce has two parts:
  5103. °dONLNd¬IlPq(Oln
  5104. °dONLNd≈GxRx) :a driver header that contains information about the driver
  5105. °dONLNd[lbq(aln
  5106. °dONLNdYxdå) the r¢`°dONLNdYåd2)&outines that do the work of the driver°dONLNd/klv(sl$The driver header contains a few wor˛@°dONLNdSkv/)•ds of fl- °dONLNd[k0vè)ags and other data, of•¿°dONLNdqkèv‹)_fsets to the driver´Ä°dONLNdÑk›vÊ)N’s °dONLNdáwlÇo(lrE°dONLNdàwpÇ)&outines, and an optional driver name. ¿°dONLNdÆwÇ1)©FigurÔİdONLNd≥w0ÇD)e 2-1ç°dONLNd∏wEÇÂ)$ shows the format of a driver header¨‡°dONLNd‹wÂÇÁ)†.ˇ4B@ˇ ˇˇˇˇ@
  5107. ˇ·ˇ‚7^
  5108. 4H\, Palatino
  5109. .+ä"CHAPTER œ´)\2,     Helvetica
  5110.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5111. 
  5112. ‡(‡2ù)-‡)7
  5113. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5114. 1/91(¯ä Second line.4^H¿
  5115. gHw4gHw"gH_
  5116. ˇ·ˇ‚7^
  5117.     °dONLNdˇˇ(dä
  5118. Figure 2-1,
  5119. Courier.°dONLNd\Ãg€)BThe°dONLNd\€g?) format of a driver header
  5120. „HÚ4„HÚ.°dONLNdˇˇ(ÍäField descriptions
  5121. ˇ·ˇ‚7^
  5122. .°dONLNdÔä˚¿*    drvrFlags.°dONLNd(Ê˚)\
  5123. Contains fl£¿°dONLNd3˚`)0ags in its high-or∫°dONLNdE`˚›)Jder byte that specify certain °dONLNdc¸Ê^(Êcharacteristics of the driver„ °dONLNdĸ]b)w. µÄ°dONLNdǸbh)Yv°dONLNdɸh‡)ou can use the constants in ``°dONLNdü¸·)y Listing 2-1†°dONLNd™¸)/ °dONLNd´Ê"(Êto index the fli¿°dONLNd∫#X)=
  5124. ags in this fiµÄ°dONLNd»Xh)5eld..°dONLNdÕä"¿(ä    drvrDelay.°dONLNd◊Ê"»)\3Indicates number of ticks between periodic actions..°dONLNd %ä1¿(.ä    drvrEMask.°dONLNd&Ê1l)\Used for desk accessories. See %`°dONLNd4&m1|)á“Wh°dONLNd6&{1∂)riting a Desk B‡°dONLNdD&∂1);Accessory” on page °dONLNdW2Ê=Ó(:Ê2-”‡°dONLNdY2Ó=¯)31”‡°dONLNd[2¯=u)
  5125.  for information about this fiW¿°dONLNdy2v=Ü)~eld..°dONLNd~@äL∫(IädrvrMenu.°dONLNdáAÊLl)\Used for desk accessories. See %`°dONLNd¶AmL|)á“Wh°dONLNd®A{L∂)riting a Desk B‡°dONLNd∂A∂L);Accessory” on page °dONLNd…MÊXÓ(UÊ2-”‡°dONLNdÀMÓX¯)31”‡°dONLNdÕM¯Xu)
  5126.  for information about this fiW¿°dONLNdÎMvXÉ)~eld.°dONLNdÔ[äg∫(dädrvrOpen.°dONLNd¯\Êg&)\Contains an ofÑ °dONLNd\&g†)@fset to the Open driver subrô@°dONLNd"\†gæ)zoutine..°dONLNd*jäv¿(sä    drvrPrime.°dONLNd4kÊv&)\Contains an ofÑ °dONLNdBk&v¢)@fset to the Prime driver subr¢Ä°dONLNd_k¢v¿)|outine..°dONLNdgyäÖ¥(ÇädrvrCtl.°dONLNdozÊÖ&)\Contains an ofÑ °dONLNd}z&Öm)@fset to the ContrõİdONLNdézmÖ©)Gol driver subr„`°dONLNdúz©Ö«)<outine..°dONLNd§àäîΔ(ëä
  5127. drvrStatus.°dONLNdØâÊî&)\Contains an ofÑ °dONLNdΩâ&î¢)@fset to the Status driver subr(‡°dONLNd€â£î¡)}outine..°dONLNd„ó䣿(†ä    drvrClose.°dONLNdÌòÊ£&)\Contains an ofÑ °dONLNd˚ò&£†)@fset to the Close driver subrõ¿°dONLNdò†£æ)zoutine.
  5128. wä…4wä…
  5129. wä…‚4vâwäò(ò4ò4w䂟Ÿ =Ä˙`Ê f˘``Ê aˇ˙{w‡Ê
  5130. =øÄ˚cˇ`Ê Ï˙c«`Ê
  5131. }ˇÄ˚c‡ÊŸŸŸŸŸ
  5132. ¿ÒˇÌ
  5133.  Òˇ¯Ì
  5134.  Òˇ¯Ì
  5135.  Òˇ¯Ì
  5136.  Òˇ¯Ì
  5137. ¿Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5138. ¿Òˇ¯Ì
  5139.  Òˇ¯Ì
  5140.  Òˇ¯Ì
  5141. ¿Òˇ¯Ì
  5142. Òˇ¯Ì
  5143. ‡Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5144. @Òˇ¯Ì
  5145. ¿Òˇ¯Ì
  5146. @Òˇ¯Ì
  5147. ‡Òˇ¯Ì
  5148. @Òˇ¯Ì
  5149. @Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5150. ‡Òˇ¯Ì
  5151. Òˇ¯Ì
  5152. ¿Òˇ¯Ì
  5153.  Òˇ¯Ì
  5154.  Òˇ¯Ì
  5155. ¿Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5156. ¿Òˇ¯Ì
  5157.  Òˇ¯Ì
  5158.  Òˇ¯Ì
  5159. ¿Òˇ¯Ì
  5160.  Òˇ¯Ì
  5161. ¿Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5162. 0Òˇ¯Ì
  5163. HÒˇ¯Ì
  5164. HÒˇ¯Ì
  5165. HÒˇ¯Ì
  5166. HÒˇ¯Ì
  5167. 0Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5168. 0Òˇ¯Ì
  5169. HÒˇ¯Ì
  5170. Òˇ¯Ì
  5171. 0Òˇ¯Ì
  5172. @Òˇ¯Ì
  5173. xÒˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5174. Òˇ¯Ì
  5175. 0Òˇ¯Ì
  5176. PÒˇ¯Ì
  5177. xÒˇ¯Ì
  5178. Òˇ¯Ì
  5179. Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5180. 8Òˇ¯Ì
  5181. @Òˇ¯Ì
  5182. pÒˇ¯Ì
  5183. HÒˇ¯Ì
  5184. HÒˇ¯Ì
  5185. 0Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5186. Òˇ¯Ì
  5187. $Òˇ¯Ì
  5188. $Òˇ¯Ì
  5189. Òˇ¯Ì
  5190. $Òˇ¯Ì
  5191. Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5192. 0Òˇ¯Ì
  5193. HÒˇ¯Ì
  5194. HÒˇ¯Ì
  5195. 8Òˇ¯Ì
  5196. Òˇ¯Ì
  5197. pÒˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  5198. ˛Úˇ¯ÌŸŸŸŸŸŸŸŸŸŸŸŸŸŸ¸ =‡/y‡˝    Ä@¯¸
  5199.  Hå
  5200. Ş @¯¸
  5201.  
  5202. HJ(Ş  ¯!¸!HJ(ÅÓsÅé'Qy¡    Áy¿˙ ¸="‡àJ(8A˘ë    d$QÖ˙ëÖ˘ ¸!"8àIKëAëy$$J˝ ˜ë˝˘ ¸!"àIHAëâ$$JÅ
  5203. ëÅ˘ ¸!&àâH
  5204. AëôdDJA        ìA˘ ¸!‡OàxÅhÅÑ
  5205. ÑD9Êç9˘˚˛@˝ÄÈ˚˛@˝ÄÈ˚˛ ˛Ë ¸  Å@@˛ A^˘ ¸  0 @˛Q˛ɢ ¸  P @˛ êÄE˘%¸'òèxW ^qÜXx√yxêûä3¡E8Ò√fip˛%¸$dëÑPíQ&idÖ,—""QfE°äL!Eà$a@˛%¸$Pë¸ó†Q$$D˛Q""QBEøRá·)<â‰@˛%¸$LëÄò†Q$#DÇQ""QBE†RÑ)Dä$`@˛%¸$Dì@ôêQ&aDA —&&QfFRB)Läd–@˛%¸$xç8éQéDú8„IF"9¡4â£N@˛
  5206. ÚÓ@˝
  5207. ÚÓÄ˝fl¸¸ĸ͸  ˝@͸
  5208. ˝@͸
  5209. <y< =œÁúx¿Ï¸
  5210. "EB3"(ëHPE Ï¸ !"E~!"(ëO–Fθ ?"E@!"(ëHFθ !2e 3",ëDEθ
  5211. @¨Yå"+#ëD‡Ï˚ @˝È˚ @˝È ˚ @˝Ê¸‡F˛Iȸ  H˛I̸ @P˛I̸0ÉéÂ`âÔÄIDŒw8«Ó¸ÄHâ`âIE$@ì4Ó¸C»â‡PâIDÑGíÓ¸$HâHâIDdHíÓ¸»ëDâID$Iì4Ó¸8Å HëByêI=¬FàƒÓÛ ËÛ ËŸ ¸%¸Ä@Á¸%@†Á¸%AÁ¸%"nw8√ÄAÁ¸%"î@ì2ÅÁ¸%"DGíAÁ¸%"4HíAÁ¸%"Iì2@†Á¸%‚Fà¬à@ÁŸŸŸò(ò4ò4w䂟Ÿ =Ä˙`Ê f˘``Ê aˇ˙{w‡Ê
  5212. =øÄ˚cˇ`Ê Ï˙c«`Ê
  5213. }ˇÄ˚c‡ÊŸŸŸŸŸ
  5214. ¿ÒˇÌ  ÄÚÌ  ÄÚÌ  ÄÚÌ  ÄÚÌ ¿ÄÚÌ
  5215. ˛ÄÚÌ
  5216. ˛ÄÚÌ
  5217. ˛ÄÚÌ
  5218. ˛ÄÚÌ
  5219. ˛ÄÚÌ˛Ä¸x˙Ì˛Ä¸H˙Ì˛Ä¸^K鿸Ì˛Ä¸&Tx”‡¸Ì˛Ä¸&TKS†¸Ì˛Ä¸$IŒ¿¸Ì˛Ä˘˚Ì˛Ä˘˚Ì
  5220. ˛ÄÚÌ
  5221. ˛ÄÚÌ
  5222. ˛ÄÚÌ
  5223. ˛ÄÚÌ
  5224. ˛ÄÚÌ
  5225. ˛ÄÚÌ
  5226. ˛ÄÚÌ ¿ÄÚÌ
  5227.  Òˇ¯Ì  ÄÚÌ ¿ÄÚÌ ÄÚÌ ‡ÄÚÌ
  5228. ˛ÄÚÌ
  5229. ˛ÄÚÌ
  5230. ˛ÄÚÌ
  5231. ˛ÄÚÌ
  5232. ˛ÄÚÌ
  5233. ˛ÄÚÌ˛Ä¸‡@˚Ì˛Ä¸ê@˚Ì˛Ä¸;^ì\∞¸Ì˛Ä¸JTóΔ†¸Ì˛Ä¸JTîZ†¸Ì˛Ä¸:$„Œ@¸Ì˛Ä¯@¸Ì˛Ä¯Ä¸Ì
  5234. ˛ÄÚÌ
  5235. ˛ÄÚÌ
  5236. ˛ÄÚÌ
  5237. ˛ÄÚÌ
  5238. ˛ÄÚÌ
  5239. ˛ÄÚÌ
  5240. ˛ÄÚÌ @ÄÚÌ
  5241. ¿Òˇ¯Ì @ÄÚÌ ‡ÄÚÌ @ÄÚÌ @ÄÚÌ
  5242. ˛ÄÚÌ
  5243. ˛ÄÚÌ
  5244. ˛ÄÚÌ
  5245. ˛ÄÚÌ
  5246. ˛ÄÚÌ˛Ä¸ ‚ ¸Ì˛Ä¸ 6 ¸Ì˛Ä¸Ìz6q¨¸Ì˛Ä˝)Sˆ¸Ì˛Ä˝)R*kh¸Ì˛Ä¸ËìÍ9§¸Ì
  5247. ˛ÄÚÌ
  5248. ˛ÄÚÌ
  5249. ˛ÄÚÌ
  5250. ˛ÄÚÌ
  5251. ˛ÄÚÌ
  5252. ˛ÄÚÌ
  5253. ˛ÄÚÌ
  5254. ˛ÄÚÌ
  5255. ˛ÄÚÌ ‡ÄÚÌ
  5256. Òˇ¯Ì ¿ÄÚÌ  ÄÚÌ  ÄÚÌ ¿ÄÚÌ
  5257. ˛ÄÚÌ
  5258. ˛ÄÚÌ
  5259. ˛ÄÚÌ
  5260. ˛ÄÚÌ
  5261. ˛ÄÚÌ˛Ä¸˙Ì˛Ä¸∞˙Ì˛Ä¸_±π ¸Ì˛Ä¸&U≥ ¸Ì˛Ä¸&UR% ¸Ì˛Ä¸%Q‰‡¸Ì
  5262. ˛ÄÚÌ
  5263. ˛ÄÚÌ
  5264. ˛ÄÚÌ
  5265. ˛ÄÚÌ
  5266. ˛ÄÚÌ
  5267. ˛ÄÚÌ
  5268. ˛ÄÚÌ
  5269. ˛ÄÚÌ
  5270. ˛ÄÚÌ
  5271. ˛ÄÚÌ ¿ÄÚÌ
  5272.  Òˇ¯Ì  ÄÚÌ ¿ÄÚÌ  ÄÚÌ ¿ÄÚÌ
  5273. ˛ÄÚÌ
  5274. ˛ÄÚÌ
  5275. ˛ÄÚÌ
  5276. ˛ÄÚÌ
  5277. ˛ÄÚÌ˛Ä¸0˙Ì˛Ä¸H˙Ì˛Ä¸^áô¿¸Ì˛Ä¸&TÜ} ¸Ì˛Ä¸&TJa ¸Ì˛Ä¸$3ù ¸Ì˛Ä˙˙Ì˛Ä˙˙Ì˛Ä˙˙Ì
  5278. ˛ÄÚÌ
  5279. ˛ÄÚÌ
  5280. ˛ÄÚÌ
  5281. ˛ÄÚÌ
  5282. ˛ÄÚÌ
  5283. ˛ÄÚÌ 0ÄÚÌ
  5284. HÒˇ¯Ì HÄÚÌ HÄÚÌ HÄÚÌ 0ÄÚÌ
  5285. ˛ÄÚÌ
  5286. ˛ÄÚÌ
  5287. ˛ÄÚÌ
  5288. ˛ÄÚÌ
  5289. ˛ÄÚÌ
  5290. ˛ÄÚÌ˛Ä¸·˙Ì˛Ä¸ê˙Ì˛Ä¸;ºùh¿¸Ì˛Ä¸J®ÈU‡¸Ì˛Ä¸J®âU˚Ì˛Ä¸:HâT‡¸Ì
  5291. ˛ÄÚÌ
  5292. ˛ÄÚÌ
  5293. ˛ÄÚÌ
  5294. ˛ÄÚÌ
  5295. ˛ÄÚÌ
  5296. ˛ÄÚÌ
  5297. ˛ÄÚÌ
  5298. ˛ÄÚÌ
  5299. ˛ÄÚÌ 0ÄÚÌ
  5300. HÒˇ¯Ì ÄÚÌ 0ÄÚÌ @ÄÚÌ xÄÚÌ
  5301. ˛ÄÚÌ
  5302. ˛ÄÚÌ
  5303. ˛ÄÚÌ
  5304. ˛ÄÚÌ
  5305. ˛ÄÚÌ˛Ä˚ ˚Ì˛Ä˚ ò˚Ì˛Ä˚˙¯8˚Ì˛Ä¸2®˚Ì˛Ä¸2§ò˚Ì˛Ä˚Ò#˚Ì
  5306. ˛ÄÚÌ
  5307. ˛ÄÚÌ
  5308. ˛ÄÚÌ
  5309. ˛ÄÚÌ
  5310. ˛ÄÚÌ
  5311. ˛ÄÚÌ
  5312. ˛ÄÚÌ
  5313. ˛ÄÚÌ
  5314. ˛ÄÚÌ ÄÚÌ
  5315. 0Òˇ¯Ì PÄÚÌ xÄÚÌ ÄÚÌ ÄÚÌ
  5316. ˛ÄÚÌ
  5317. ˛ÄÚÌ
  5318. ˛ÄÚÌ
  5319. ˛ÄÚÌ
  5320. ˛ÄÚÌ˛Ä¸Ë˚Ì˛Ä¸˚Ì˛Ä¸wyflπ0¸Ì˛Ä¸ïP®Ÿx¸Ì˛Ä¸ïR+Yh¸Ì˛Ä¸tëÕfl0¸Ì
  5321. ˛ÄÚÌ
  5322. ˛ÄÚÌ
  5323. ˛ÄÚÌ
  5324. ˛ÄÚÌ
  5325. ˛ÄÚÌ
  5326. ˛ÄÚÌ
  5327. ˛ÄÚÌ
  5328. ˛ÄÚÌ
  5329. ˛ÄÚÌ
  5330. ˛ÄÚÌ 8ÄÚÌ
  5331. @Òˇ¯Ì pÄÚÌ HÄÚÌ HÄÚÌ 0ÄÚÌ
  5332. ˛ÄÚÌ
  5333. ˛ÄÚÌ
  5334. ˛ÄÚÌ
  5335. ˛ÄÚÌ
  5336. ˛ÄÚÌ˛Ä¸d˙Ì˛Ä¸î˙Ì˛Ä¸;_ÿ¸Ì˛Ä¸JU?‡¸Ì˛Ä¸JTï;˚Ì˛Ä¸:$dǸÌ
  5337. ˛ÄÚÌ
  5338. ˛ÄÚÌ
  5339. ˛ÄÚÌ
  5340. ˛ÄÚÌ
  5341. ˛ÄÚÌ
  5342. ˛ÄÚÌ
  5343. ˛ÄÚÌ
  5344. ˛ÄÚÌ ÄÚÌ $ÄÚÌ
  5345. $Òˇ¯Ì ÄÚÌ $ÄÚÌ ÄÚÌ˛Ä¸˙Ì˛Ä¸ê˙Ì˛Ä¸;ΩWh`¸Ì˛Ä¸J©Q‘¸Ì˛Ä¸J©6‘ĸÌ˛Ä¸:I‘p¸Ì
  5346. ˛ÄÚÌ
  5347. ˛ÄÚÌ
  5348. ˛ÄÚÌ
  5349. 0Òˇ¯Ì HÄÚÌ HÄÚÌ 8ÄÚÌ ÄÚÌ pÄÚÌ
  5350. ˛ÄÚÌ
  5351. ˛ÄÚÌ
  5352. ˛ÄÚÌ
  5353. ˛ÄÚÌ
  5354. ˛ÄÚÌ
  5355. ˛ÄÚÌ
  5356. ˛ÄÚÌ
  5357. ˛ÄÚÌ
  5358. ˛ÄÚÌ
  5359. ˛ÄÚÌ
  5360. ˛ÄÚÌ
  5361. ˛ÄÚÌ
  5362. ˛ÄÚÌ
  5363. ˛ÄÚÌ
  5364. ˛ÄÚÌ
  5365. ˛ÄÚÌ
  5366. ˛ÄÚÌ
  5367. ˛ÄÚÌ
  5368. ˛ÄÚÌ
  5369. ˛ÄÚÌ
  5370. ˛ÄÚÌ
  5371. ˛ÄÚÌ
  5372. ˛ÄÚÌ
  5373. ˛ÄÚÌ
  5374. ˛ÄÚÌ˛Ä˝0¸˝Ì˛Ä˝d˛0˝Ì˛Ä˝}Nµö¿ ˝Ì˛Ä˝ñ≥m’‡p˝Ì˛Ä˝~'gu¿ 8˝Ì
  5375. ˛ÄÚÌ
  5376. ˛ÄÚÌ
  5377. ˛ÄÚÌ
  5378. ˛ÄÚÌ
  5379. ˛ÄÚÌ
  5380. ˛ÄÚÌ
  5381. ˛ÄÚÌ
  5382. ˛ÄÚÌ
  5383. ˛ÄÚÌ
  5384. ˛ÄÚÌ
  5385. ˛ÄÚÌ
  5386. ˛ÄÚÌ
  5387. ˛ÄÚÌ
  5388. ˛ÄÚÌ
  5389. ˛ÄÚÌ
  5390. ˛ÄÚÌ
  5391. ˛ÄÚÌ
  5392. ˛ÄÚÌ
  5393. ˛ÄÚÌ
  5394. ˛ÄÚÌ
  5395. ˛ÄÚÌ
  5396. ˛ÄÚÌ
  5397. ˛ÄÚÌ
  5398. ˛ÄÚÌ
  5399. ˛ÄÚÌ
  5400. ˛ÄÚÌ
  5401. ˛ÄÚÌ
  5402. ˛ÄÚÌ
  5403. ˛ÄÚÌ
  5404. ˛ÄÚÌ
  5405. ˛ÄÚÌ˛Òˇ¯Ì
  5406. ˛Úˇ¯ÌŸŸŸŸŸŸŸŸŸŸŸŸŸŸ¸ =‡/y‡˝    Ä@¯¸
  5407.  Hå
  5408. Ş @¯¸
  5409.  
  5410. HJ(Ş  ¯!¸!HJ(ÅÓsÅé'Qy¡    Áy¿˙ ¸="‡àJ(8A˘ë    d$QÖ˙ëÖ˘ ¸!"8àIKëAëy$$J˝ ˜ë˝˘ ¸!"àIHAëâ$$JÅ
  5411. ëÅ˘ ¸!&àâH
  5412. AëôdDJA        ìA˘ ¸!‡OàxÅhÅÑ
  5413. ÑD9Êç9˘˚˛@˝ÄÈ˚˛@˝ÄÈ˚˛ ˛Ë ¸  Å@@˛ A^˘ ¸  0 @˛Q˛ɢ ¸  P @˛ êÄE˘%¸'òèxW ^qÜXx√yxêûä3¡E8Ò√fip˛%¸$dëÑPíQ&idÖ,—""QfE°äL!Eà$a@˛%¸$Pë¸ó†Q$$D˛Q""QBEøRá·)<â‰@˛%¸$LëÄò†Q$#DÇQ""QBE†RÑ)Dä$`@˛%¸$Dì@ôêQ&aDA —&&QfFRB)Läd–@˛%¸$xç8éQéDú8„IF"9¡4â£N@˛
  5414. ÚÓ@˝
  5415. ÚÓÄ˝fl¸¸ĸ͸  ˝@͸
  5416. ˝@͸
  5417. <y< =œÁúx¿Ï¸
  5418. "EB3"(ëHPE Ï¸ !"E~!"(ëO–Fθ ?"E@!"(ëHFθ !2e 3",ëDEθ
  5419. @¨Yå"+#ëD‡Ï˚ @˝È˚ @˝È ˚ @˝Ê¸‡F˛Iȸ  H˛I̸ @P˛I̸0ÉéÂ`âÔÄIDŒw8«Ó¸ÄHâ`âIE$@ì4Ó¸C»â‡PâIDÑGíÓ¸$HâHâIDdHíÓ¸»ëDâID$Iì4Ó¸8Å HëByêI=¬FàƒÓÛ ËÛ ËŸ ¸%¸Ä@Á¸%@†Á¸%AÁ¸%"nw8√ÄAÁ¸%"î@ì2ÅÁ¸%"DGíAÁ¸%"4HíAÁ¸%"Iì2@†Á¸%‚Fà¬à@ÁŸŸŸˇ&@ˇ ˇˇˇˇ@
  5420. ˇ·ˇ‚7^
  5421. 4*\˜, Palatino
  5422. .+l"CHAPTER œ´)\2,     Helvetica
  5423.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5424. (‡*2 )-c)8
  5425.     )9W’ê)riting a Device Driver
  5426. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5427. 1/91(¯l Second line.4^*¿¯,
  5428. Courier
  5429. .°dONLNd\lhú(eldrvrName.°dONLNd    ]»h=)\Contains the driver name. °dONLNd#]>hD)vYœÄ°dONLNd$]Chè)ou can use upperµÄ°dONLNd4]èh–)Lcase and lower]°dONLNdB]—hÂ)Bcase °dONLNdGi»tX(q»letters when naming your driver˚‡°dONLNdfiWtÉ)è , but the fi∑ °dONLNdriÑtÚ)-rst character should be a .°dONLNdåu»Ä(}»period—°dONLNdìtÄ2)( .YourDriver¬†°dONLNdûu1Äq)A, for example..°dONLNd≠álíØ(èlSee the section ò‡°dONLNdΩáØí)C“Entering and Exiting FrF¿°dONLNd’áía)mom Driver SubrİdONLNd„áaí∂)Eoutines” on page 2-İdONLNdˆá∑íº)V9İdONLNd˜áºífl) for morfi°dONLNdˇáflíÊ)#e °dONLNdìlû„(õlinformation about the subrp °dONLNdì„û
  5430. )w    outine ofŒ@°dONLNd$ì
  5431. û )'fsets.
  5432. ´*∏¯4¨*∑¯
  5433. °dONLNdˇˇ(≥lNOTE
  5434. ˇ·ˇ‚7^
  5435. °dONLNd+∂l¡r* Y@İdONLNd,∂r¡•) our driver rŒ°dONLNd8∂•¡S)3'outines, which follow the driver headerÚ†°dONLNd_∂S¡°)Æ, must be aligned °dONLNdq¬lÕì( lon a worX`°dONLNdy¬ìÕ«)'
  5436. d boundaryKİdONLNdɬΔÕ»)3.,
  5437.  
  5438. Zapf Dingbats
  5439. ÀİdONLNdˇˇ)u
  5440. *Û¯4*Û¯"*a
  5441. ˇ·ˇ‚7^
  5442.     °dONLNdˇˇ(Ìl Listing 2-1°dONLNdôÂ∞K)D'The index constants for the drvrFlags fi‡°dONLNd¡ÂLX)úeld
  5443. .°dONLNd≈˝l    Æ(l dReadEnable°dONLNd◊˝¥    Ã)H EQU°dONLNd›˝ÿ    Ê)$-0 ;set if driver can respond to Read requests°dONLNd  lÆ(l dWritEnable°dONLNd ¥Ã)H EQU°dONLNd# ÿÏ)$.1 ;set if driver can respond to Write requests°dONLNdRl%®("l
  5444. dCtlEnable°dONLNdc¥%Ã)H EQU°dONLNdiÿ%¯)$02 ;set if driver can respond to Control requests°dONLNdö'l3Ã(0ldStatEnable  EQU°dONLNd≥'ÿ3Ú)l/3 ;set if driver can respond to Status requests°dONLNd„5lA¥(>l dNeedGoodbye°dONLNdˆ5¥AÃ)H EQU°dONLNd¸5ÿAÏ)$.4 ;set if driver needs to be called before the°dONLNd4CÿO™*#  ; application heap is initialized°dONLNdXQl]¢(Zl    dNeedTime°dONLNdcQ¢]Æ)6  °dONLNdjQ¥]Ã) EQU°dONLNdpQÿ]‘)$*5 ;set if driver needs time for performing°dONLNd§_ÿkD*  ; periodic tasks°dONLNd∑mly¢(vl    dNeedLock°dONLNd¬m¢y∫)6    °dONLNdÀm∫yÃ)EQU°dONLNd–mÿy‡),6 ;set if driver will be locked in memory as°dONLNd{ÿáb*  ; soon as it's opened.°dONLNdîlüÖ(úlThe fi»Ä°dONLNd$îÖüÆ)
  5445. rst four fl
  5446. `°dONLNd/îØüc)*)ags, which occupy bits 0–3 of the high-orV°dONLNdXîcüÆ)¥der byte (bits 8–1á`°dONLNdjîÆü—)K    1 of the ˇˇˆp.°dONLNdsül´¢(®l    drvrFlagsˇˇ˚8°dONLNd|†¢´µ)6 worMò°dONLNdĆ∂´a)#d), indicate which Device Manager r°dONLNd£†b´¥)¨equests the driverª‡°dONLNdµ†µ´¬)S’s râx°dONLNdπ†√´˜) outines can .°dONLNd≈¨l∑o(¥lrE°dONLNdΔ¨p∑Ì)espond to. The next section, íİdONLNd„¨Ì∑ç)}!“Responding to the Device ManagerưdONLNd¨ç∑î)†,”.°dONLNd¨ï∑•) on t‡°dONLNd
  5447. ¨•∑≈)page 2-£†°dONLNd¨≈∑ ) 9£†°dONLNd¨ ∑Ã) °dONLNd∏l√¥(¿ldescribes these r$‡°dONLNd$∏µ√)Ioutines in detail. °dONLNd8 l’(“l"Drivers in the application heap arÁ‡°dONLNdZ ’j)îe lost when the heap is r∑°dONLNds k’›)keinitialized. If you set the .°dONLNdê’l·¥(fil dNeedGoodbye°dONLNdú÷¥·ª)H fPİdONLNdû÷ª·ò)/lag, the Device Manager calls your driver befor"‡°dONLNdÕ÷ò·Ÿ)›e the heap is .°dONLNd€‚lÌo(ÍlrE°dONLNd‹‚pÌÅ)?einitialized so that you can perform any clean-up actions. See Y °dONLNd‚ÅÌê(ÍÅ“Wõ¿°dONLNd‚èÌ”)riting the ContrD†°dONLNd-‚‘ÌÚ)Eol and °dONLNd4Ól˘û(ˆl Status Subrú °dONLNd?Óû˘Û)2outines” on page 2-ë °dONLNdRÓÙ˘˛)V15ë °dONLNdTÓ˛˘!)
  5448.  for mor[†°dONLNd\Ó"˘K)$ e details. .°dONLNdhl s(lYï°dONLNdir ¢) ou set the ï°dONLNdtˇ¢ ÿ)0    dNeedTimeï°dONLNd}ÿ ‚)6 flï°dONLNdÄ‚ )
  5449.  
  5450. ag of the ï°dONLNdäˇ E)-    drvrFlagsï°dONLNdìE Y)6 worg`°dONLNdóY Ì)!d if your device driver needs to .°dONLNd∏ l˛(l perform some action periodicallyU °dONLNdÿ ˛Ê)í5. For example, a network driver may want to poll its °dONLNd
  5451. l#ï( l    input buf∫`°dONLNdï#.))&fer every 5 seconds to see if it has rfi¿°dONLNd<.#›)ô'eceived any messages. The value of the ˇˇ≤B.°dONLNdc#l/¢(,l    drvrDelayˇˇŸ!°dONLNdl$¢/µ)6 wor+ŰdONLNdp$∂/¯)Ed indicates how many ticks should pass between periodic actions. For ˇ˛r⁄°dONLNdµ0l;Á(8lexample, a value of 0 in the ˇ¸Â¥£ˆ°dONLNd“/Á;){    drvrDelayˇ˛r⁄£ˆ°dONLNd€0;/)6 worÈ0°dONLNdfl0/;˜)-d indicates that the action should happen as .°dONLNd <lGÛ(Dl[often as possible, a value of 1 means it should happen every sixtieth of a second, a value °dONLNdgHlSÂ* Wof 2 means at most every thirtieth of a second, and so on. Whether the action actually °dONLNdæTl_•* occurs this fr^¿°dONLNdÃT•_·)9Eequently depends on how often the application calls the Desk Manager ˇˇtP.°dONLNd    `lkv(hlprR`°dONLNd    `vkì)
  5452. ocedur$¿°dONLNd    `ìkö)e ˇ˛Ë†ô°dONLNd    _ök÷)
  5453. SystemTaskˇˇtPô°dONLNd    %`÷kÌ)<. See Å∞°dONLNd    +`Ók˛)“WƒP°dONLNd    -`˝kD)riting the ContrP°dONLNd    =`Ekó)Hol and Status SubrƆ°dONLNd    O`ókÎ)Routines” on page 2- ê°dONLNd    b`Ïkˆ)U15 ê°dONLNd    d`ˆk¯)
  5454.  .°dONLNd    ellwç(tlfor mor Ä°dONLNd    llçw≥)!
  5455. e details.ˇˆ@ˇ ˇˇˇˇ@
  5456. ˇ·ˇ‚7^
  5457. 4H\, Palatino
  5458. .+ä"CHAPTER œ´)\2,     Helvetica
  5459.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5460. 
  5461. ‡(‡2ù)-‡)9
  5462. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5463. 1/91(¯ä Second line.4^H¿
  5464. ^Hj4^Hj
  5465. °dONLNdˇˇ(eäNOTE
  5466. ˇ·ˇ‚7^
  5467. °dONLNdhäs¶* AIf you do not want your driver to depend on applications to call ,
  5468. Courierˇ˝ˇ¸.°dONLNdAsäΔ*
  5469. SystemTaskˇ˛ˇ˛°dONLNdKtΔ√)<;, you can still perform actions periodically by installing .°dONLNdÜÄäã§(àäa VBL@°dONLNdãÄ•ã‚) task, a Deferr{¿°dONLNdöÄ‚ãı)=ed T‡°dONLNdûÄıãU)ask Manager task, a Tó†°dONLNd≥ÄTãª)_ime Manager task, or a °dONLNd åäó£(îäNotifi{‡°dONLNd–å§ó&)cation Manager task. For morѰdONLNdÏå&óØ)Ç e information, see the chapters °dONLNd òä£õ(†äcorr`°dONLNdòú£)esponding to these managers.,
  5470.  
  5471. Zapf Dingbats
  5472. õ@°dONLNdˇˇ)Üu
  5473. ˇˇ‰î.°dONLNdA™äµë(≤äYï°dONLNdB™êµ„)ou need to set the ˇˇ…( ‰°dONLNdU©‰µ)T    dNeedLockˇˇ‰î ‰°dONLNd^™µ#)6 flx°dONLNda™#µo)    ag if your driver[î°dONLNdr™qµ)N"’s code should be locked in memoryõL°dONLNd)ü. .°dONLNdñ∂ä¡¡(æä
  5474. In particular‰`°dONLNd£∂¿¡#)6, you need to set this fl7@°dONLNdº∂$¡Ç)dag in these two cases:
  5475. °dONLNd” ä—è(–än
  5476. °dONLNd’»ñ”) If any part of your driver(`°dONLNdÔ»”Ö)p’s code can be called at interrä`°dONLNd»Ö”Ø)
  5477. upt time. ¿°dONLNd»Ø”’)*    At interr‡†°dONLNd!»’”)&upt time, the °dONLNd/‘ñfl(‹ñYheap may not be in a consistent state. If your driver is not locked, the system could be °dONLNdà‡ñΪ*     in the prfi@°dONLNd뇪΄)%
  5478. ocess of rñ°dONLNdõ‡‰ÎG))elocating it in memoryj†°dONLNd±‡GÎI)c.
  5479. °dONLNd≥Ùä˚è(˙än
  5480. °dONLNdµÚñ˝fi) If your driver pr— °dONLNdΔÚfi˝)HDovides the Operating System with a pointer to any part of its code. °dONLNd
  5481. ˛ñ    ›(ñJFor example, if your driver uses the Device Manager to call another driver∫†°dONLNdT˛›    (› , you might °dONLNd`
  5482. ñü(ñprG °dONLNdb
  5483. †õ)
  5484. 7ovide the Device Manager with a pointer to completion rN‡°dONLNdô
  5485. õ
  5486. )˚outine. If that completion °dONLNd¥ñ!ô(ñrE°dONLNdµö!¯)Poutine is in your driver code, your driver code must be locked. Otherwise, that °dONLNd"ñ-ˆ(*ñOpointer might not be valid by the time the Device Manager calls the completion °dONLNdT.ñ9ô* rE°dONLNdU.ö9∏)outine.°dONLNd]@äKê(HäY@İdONLNd^@êK∏)    ou can cr4°dONLNdg@∏K`)(&eate your driver header in these ways:
  5487. °dONLNdéTä[è(Zän
  5488. °dONLNdêRñ]ú) Y@İdONLNdëRú]ÿ)ou can use a r—İdONLNdüRÿ])<esour¿°dONLNd§RÒ]$) ce compiler_ °dONLNdØR#]9)2. See ≤ °dONLNdµR9]])“Resour®`°dONLNdºR]]ü)$ces” on page 2-dONLNdÀR†]™)C38dONLNdÕR™]
  5489. )
  5490.  for the Rez format of °dONLNd‰^ñi»(fñ the driver r{†°dONLNd^»i‡)2esour√‡°dONLNdı^‡iÎ)ce.
  5491. °dONLNd˘räyè(xän
  5492. .°dONLNd˚pñ{ù) Yï°dONLNd¸pú{fl)ou can use the ï°dONLNd ofl{Î)CDCï°dONLNd
  5493. pÎ{)  instrŰdONLNdp{])uction, as shown in ŰdONLNd'p]{ç)Z Listing 2-2ŰdONLNd2pç{˛)0, to position the header .°dONLNdK|ñá⁄(Ññinformation dirÑİdONLNdZ|⁄áÇ)D%ectly in your assembly language code.
  5494. ™H≠4™H≠"™Ha
  5495. ˇ·ˇ‚7^
  5496.     °dONLNdˇˇ(ßä Listing 2-2°dONLNdˇˇ)D Åê°dONLNdÅü–™c)"An assembly-language driver header
  5497. .°dONLNd§∑ä√¥(¿äDHeader°dONLNd¨≈ä—Æ*DFlags°dONLNd∏≈¿—ÿ)6DC.B°dONLNdæ≈‰—Í)$0°dONLNd≈≈P—∂)l ;set by DRVROpen°dONLNd›”¿flÿ(‹¿DC.B°dONLNd„”‰flÍ)$0°dONLNdÍ”Pfl∂)l ;set by DRVROpen°dONLNd¸·äÌÆ(ÍäDDelay°dONLNd·¿Ìÿ)6DC.W°dONLNd·‰ÌÍ)$0°dONLNd·PÌt)l ;none°dONLNdÔä˚Æ(¯äDEMask°dONLNd(Ô¿˚ÿ)6DC.W°dONLNd.Ô‰˚Í)$0°dONLNd5ÔP˚™)l ;DA event mask°dONLNdE˝ä    ®(äDMenu°dONLNdP˝¿    ÿ)6DC.W°dONLNdV˝‰    Í)$0°dONLNd]˝P    Ü)l     ;no menu°dONLNdm ¿ÿ(¿DC.W°dONLNds ‰)$DOpen°dONLNdy >)
  5498.  - DHeader°dONLNdà P∞)N ;offset to Open°dONLNdü¿%ÿ("¿DC.W°dONLNd•‰%)$DPrime°dONLNd¨%D)$
  5499.  - DHeader°dONLNdªP%∂)H ;offset to Prime°dONLNd”'¿3ÿ(0¿DC.W°dONLNdŸ'‰3V)$DControl - DHeader °dONLNdÚ'V3¬)r;offset to Control°dONLNd 5¿Aÿ(>¿DC.W°dONLNd5‰A)$DStatus°dONLNd5AJ)*
  5500.  - DHeader°dONLNd(5PAº)B ;offset to Status°dONLNdAC¿Oÿ(L¿DC.W°dONLNdGC‰O)$DClose°dONLNdNCOD)$
  5501.  - DHeader°dONLNd]CPO∂)H ;offset to Close°dONLNdp_äk¢(häName°dONLNdz_¿kÿ)6DC.B°dONLNdÄ_‰k)$    '.DRIVER'°dONLNdè_Pk∞)l ;name of driver°dONLNd¶m¿yfi(v¿ALIGN°dONLNd≠m‰yÍ)$2°dONLNd¥mPyò)l  ;word alignˇˇ¯å°dONLNd¡ÜäëÎ(éäIn this example, the ˇˇÒb0°dONLNd÷ÖÏë")b    drvrFlagsˇˇ¯åb0°dONLNdflÜ"ë5)6 wor-°dONLNd„Ü6ë`)
  5502. d is clearî°dONLNdÌÜ`ë¬)*ed to 0—the actual fl“ƒ°dONLNdÜ√ëfi)cags arù∞°dONLNdÜflë)
  5503. e set in the ˇˇ™í°dONLNdëäù∫(öäDRVROpenˇˇ’I°dONLNdí∫ù¿)0 r'©°dONLNdí¡ùÒ) outine, defÕr°dONLNd*íÒù)0ined in x°dONLNd2íù$)#“W∫§°dONLNd4í#ù±)riting the Open and Close Subr∑q°dONLNdRí±ù)éoutines” on page 2-7L°dONLNdeíù )V1™¨°dONLNdfí ù)1™¨°dONLNdgíù). ˇ˛’İdONLNdiûä©ù(¶äThe ˇ˝´UİdONLNdmùû©‘)    drvrDelayˇ˛’ÄUİdONLNdvû‘©‹)6 fi+°dONLNdyû›©<)    eld is set to 0 and the ˇ˝´İdONLNdëù=©s)`    drvrEMaskˇ˛’ÄİdONLNdöûs©á)6 and ˇ˝´¨Ä°dONLNdüùá©∑)drvrMenuˇ˛’ĨİdONLNdßû∑©ø)0 fiǰdONLNd™û¿©fi)    elds ar)‡°dONLNd±ûfl©ˇ)    e set to ‘‡°dONLNd∫û©)!0, as .°dONLNd¿™äµ(≤ä#this driver is not a desk accessoryr °dONLNd„™µP)ì . The next fi@†°dONLNd™Qµc)4ve fi=@°dONLNdı™dµñ) elds give ofÀ °dONLNd    ™ñµÂ)2fsets to the driver ˇF@ˇ ˇˇˇˇ@
  5504. ˇ·ˇ‚7^
  5505. 4*\˜, Palatino
  5506. .+l"CHAPTER œ´)\2,     Helvetica
  5507.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5508. (‡*2 )-c)10
  5509.     )9W’ê)riting a Device Driver
  5510. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5511. 1/91(¯l Second line.4^*¿¯
  5512. °dONLNd]lh(elsubr¿°dONLNd]Äh∂) outines, defiÇ@°dONLNd]∂h)6ned in the next section, 憰dONLNd*]hæ)h!“Responding to the Device Manager⁄ °dONLNdK]æh≈)†.”Z °dONLNdM]Δh€) The °dONLNdRilt)(ql(header ends with the driver name and worfi °dONLNdzi)t`)Ω d alignment.
  5513. ô*ü¯4ö*ü¯ ölö¯
  5514. ˇ·ˇ‚7^
  5515. ˇˇ◊ˇ◊°dONLNdáâlô`(ïl Responding to the Device Managerˇˇˇˇˇˇ•(ï2
  5516. °dONLNd®†l´(®l&The Device Manager calls a driver subrÖ °dONLNdŒ†´x)≠outine by setting up rÄ¿°dONLNd‰†x´Û)_egisters and jumping to the °dONLNd¨l∑Å(¥laddr|İdONLNd¨Å∑Ó)ess indicated by the subrö‡°dONLNd¨Ó∑)m outine’s of˝@°dONLNd(¨∑Ü).fset in the driver header@ °dONLNdA¨Ü∑ã)j. ,
  5517.  
  5518. Zapf Dingbats
  5519. °dONLNdD¿l«q(Δln
  5520. °dONLNdGæx…û)     Register Ã`°dONLNdPæû…g)&.A0 contains a pointer to the parameter block. 
  5521. °dONLNd“lŸq(ÿln
  5522. °dONLNdÇ–x€û)     Register Ã`°dONLNdã–û€P)&)A1 contains a pointer to the device contr5İdONLNd¥–Q€s)≥ol entryV¿°dONLNdº–r€t)!.°dONLNdæ‚lÌÆ(ÍlThis interface r¢†°dONLNdŒ‚ÆÌ≈)Bequirπ‡°dONLNd”‚≈Ì“):es you to use some assembly language when writing a driveræ°dONLNd
  5523. ‚“Ì◊(Í“. °dONLNdÓl˘ï(ˆlHowever †°dONLNdÓï˘")) , you can write your driver subr`°dONLNd6Ó"˘ÿ)ç*outines in a high-level language if you prÈ¿°dONLNd`Ó◊˘Ú)µovide °dONLNdf˙l›(lQan assembly-language dispatching mechanism that acts as an interface between the °dONLNd∑l* #Device Manager and your driver subr∂‡°dONLNd⁄5)ßoutines.°dONLNd„l#5( l,The next few sections discuss how you can pr¿†°dONLNd5#í)…ovide a dispatching rˇ@°dONLNd$í#Ì)]outine and how you °dONLNd7$l/˘(,lcan implement your driver subrÀ‡°dONLNdU$˘/à)ç!outines in a high-level language.
  5524. M*T¯4N*T¯ OlO¯
  5525. ˇ·ˇ‚7^
  5526. °dONLNdw@lMË(JlEntering and Exiting FrÍ@°dONLNdé@ËM:)|om Driver SubrÜ¿°dONLNdú@;Ma)Soutinesˇˇˇˇˇˇ)∑2
  5527. °dONLNd§Ul`ö(]l Listing 2-3 @°dONLNdØUõ`$)/ shows an assembly-language r·‡°dONLNdÃU$`Î)â-outine that you can use an interface between °dONLNd˘all}(il;the Device Manager and your high-level language driver subr5`°dONLNd4a~lÏ(i~outines. In this example, °dONLNdNmlx¥(uleach driver subru@°dONLNd^m¥x£)H5outine (which the Device Manager locates using the of9‡°dONLNdìm§xÀ)    fsets defiÖ‡°dONLNdùmÀxÈ)'ned in °dONLNd§ylÑö(Ål Listing 2-2 @°dONLNdØyõÑÁ)/) pushes the addrÏ@°dONLNd¿yÁÑ )Less of its corr~`°dONLNdœy!Ñ¿):"esponding high-level language subrdİdONLNdÒy¿ÑÚ)ü outine and °dONLNd¸Ölê˘(çl then branch to the dispatching r¶`°dONLNdÖ˘ê)çoutine.
  5528. ≤*∂¯4≥*µ¯"≥*a
  5529. ˇ·ˇ‚7^
  5530.     °dONLNdˇˇ(∞l Listing 2-3°dONLNd$®∞≥^)D,Entering and exiting from driver subroutines,
  5531. Courier
  5532. .°dONLNdQølÀä(»lDOpen°dONLNd\ø¢À¥)6pea°dONLNdaøΔÀˆ)$DRVROPEN°dONLNdpÕ¢Ÿ¿(÷¢bra.s°dONLNdwÕΔŸ)$ DRVRDispatch°dONLNdâÕ2Ÿ8)l °dONLNdêÈlıê(ÚlDPrime°dONLNdúÈ¢ı¥)6pea°dONLNd°ÈΔı¸)$    DRVRPRIME°dONLNd±˜¢¿(¢bra.s°dONLNd∏˜Δ)$ DRVRDispatch°dONLNd lú(lDControl°dONLNdÿ¢¥)6pea°dONLNd›Δ)$ DRVRCONTROL°dONLNdÔ!¢-¿(*¢bra.s°dONLNdˆ!Δ-)$ DRVRDispatch°dONLNd
  5533. =lIñ(FlDStatus°dONLNd=¢I¥)6pea°dONLNd=ΔI)$
  5534. DRVRSTATUS°dONLNd-K¢W¿(T¢bra.s°dONLNd4KΔW)$ DRVRDispatch°dONLNdBglsê(plDClose°dONLNdNg¢s¥)6pea°dONLNdSgΔs¸)$    DRVRCLOSE°dONLNdbg2sÏ)l ;and fall thru to DRVRDispatchˇ >@ˇ ˇˇˇˇ@
  5535. ˇ·ˇ‚7^
  5536. 4H\, Palatino
  5537. .+ä"CHAPTER œ´)\2,     Helvetica
  5538.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5539. ~¿(‡2
  5540. ‡)-a¿)11
  5541. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5542. 1/91(¯ä Second line.4^H¿,
  5543. Courier
  5544. .°dONLNd\äh“(eä DRVRDispatch°dONLNdj¿vÍ+6movem.l°dONLNdjˆv>)6 a0/a1, -(sp)°dONLNd-j>vD)H °dONLNd/jPv¯);save registers (for IODone)°dONLNdRx¿Ñfi(Å¿clr.w°dONLNdZxˆÑ)6-(sp)°dONLNdcx>ÑD)H °dONLNdexPÑ‘);save room for result °dONLNdÇÜ¿í‰(è¿move.l°dONLNdã܈í,)6    a0, -(sp)°dONLNdòÜ>íD)H °dONLNdöÜPí˛);push paramblock ptr on stack°dONLNdæî¿†‰(ù¿move.l°dONLNd«îˆ†,)6    a1, -(sp)°dONLNd”î,†8)6  °dONLNd÷î>†D) °dONLNdÿîP†‘);push dce ptr on stack°dONLNdı¢¿Æ(´¿movea.l °dONLNd¢ˆÆ8)6 $12(sp), a0°dONLNd¢>ÆD)H °dONLNd¢PÆ) ;load address of routine into a0°dONLNd8∞¿º“(π¿jsr°dONLNd>∞ˆº)6(a0)°dONLNdF∞>ºD)H °dONLNdH∞PºÏ);jump to actual subroutine°dONLNdiæ¿ ‰(«¿move.w°dONLNdr戠,)6    (sp)+, d0°dONLNdæ> D)H °dONLNdÅæP ¬);put result into d0°dONLNdüÿÿÍ(’¿movem.l°dONLNd©Ãˆÿ>)6 (sp)+, a0/a1°dONLNdπÃ>ÿD)H °dONLNdªÃPÿ
  5545. );restore registers (for IODone)°dONLNd·⁄¿Ê‰(„¿addq.w°dONLNdÍ⁄ˆÊ)6#4, a7°dONLNdÙ⁄>ÊD)H °dONLNdˆ⁄PÊ) ;clear subroutine addr off stack°dONLNdˆ¿fi(ˇ¿cmp.w°dONLNd&ˆˆ)6#1, d0°dONLNd1ˆP¯)Z;if incomplete async routine°dONLNdT¿fi(
  5546. ¿beq.s°dONLNd\ˆ)6Done°dONLNdd>D)H °dONLNdfP) ;then rts -- don't jmp to IODone°dONLNdé ¿,ÿ()¿btst°dONLNdï ˆ,,)6    #1,$6(a0)°dONLNd£ P,¬)Z;test immediate bit°dONLNdΩ.¿:fi(7¿bne.s°dONLNd≈.ˆ:)6Done°dONLNdŒ.P:Œ)Z;rts if immed bit set°dONLNdÍ<¿H‰(E¿move.l°dONLNdÛ<ˆHJ)6JIODone, -(sp)°dONLNd<PH
  5547. )Z;push JIODone vector onto stack°dONLNd'Xäd¢(aäDone°dONLNd1X¿d“)6rtsˇˇóB°dONLNd5qä|û(yäThe ˇˇ.ÑB°dONLNd9pü|Á) DRVRDispatchˇˇóBB°dONLNdEqÁ|Ì)H rĉ°dONLNdGqÌ|j)outine begins by saving the Œ°dONLNdcqk|é)~A0 and ÊÚ°dONLNdjqç|†)"A1 rPî°dONLNdnq°|ı)egisters, clearing rQx°dONLNdÇqı|)Toom on .°dONLNdâ}äà÷(Öäthe stack for the r:İdONLNdú}◊à)MGesult code, and pushing the parameters on the stack and jumping to the °dONLNd„âäîû(ëäapprI@°dONLNdÁâüîÚ)opriate driver subr뇰dONLNd˙âÚî)Soutine. ˇˇœ4.°dONLNdõä¶Ì(£äWhen the driver subrø¸°dONLNdõ̶)coutine raê°dONLNdõ¶C)# eturns, the ˇˇûhˇ¯°dONLNd+öC¶ã)3 DRVRDispatchˇˇœ4ˇ¯°dONLNd7õã¶ë)H r°å°dONLNd9õí¶Ê)outine moves the r·à°dONLNdKõʶ)T esult code .°dONLNdVßä≤ô(Øäto r|‡°dONLNdZßô≤Œ)
  5548. egister D0, r˚‡°dONLNdgߌ≤„)5estor`°dONLNdl߉≤ˇ)es the °dONLNdsß≤")A0 and [°dONLNdzß"≤5)"A1 rg@°dONLNd~ß5≤õ)egisters, clears the subr·°dONLNdóßõ≤Œ)f outine addrü‡°dONLNd¢ßœ≤Ê)4ess fr|`°dONLNd®ßÊ≤)om the °dONLNdØ≥äæ”(ªästack, and then r_†°dONLNd¿≥”æ)I eturns contr≤@°dONLNdÃ≥æœ)5,ol to the Device Manager in one of two ways:,
  5549.  
  5550. Zapf Dingbats
  5551. °dONLNd˘«äŒè(Õän
  5552. .°dONLNd˚≈ñ–°) WÛ`°dONLNd¸≈†–¿)
  5553. ith an Û`°dONLNdƒ¿–“) RTSÛ`°dONLNd≈“–Í) instrfl`°dONLNd ≈Í– )uction. ±¿°dONLNd≈ –)!YΔ¿°dONLNd≈–»)&ou do not want the Device Manager to rô °dONLNd;≈»–)∑
  5554. emove to the °dONLNdH—ñ‹ö(ŸñrR`°dONLNdI—ö‹¡)    equest fr$¿°dONLNdR—¡‹)'om the driver r˜ °dONLNda—‹Ä)Fequest queue. In particular9¿°dONLNd|—Ä‹ô)y, the 9¿°dONLNdÇ–ô‹·) DRVRDispatch9¿°dONLNdé—·‹Ë)H r  °dONLNdê—Ë‹)outine ˇˇ
  5555. °dONLNdó›ñËö(ÂñrR`°dONLNdò›öË›)eturns with an ˇ˛$yñ°dONLNdß‹›ËÔ)CRTSˇˇ
  5556. yñ°dONLNd™›ÔË) instrr®°dONLNd∞›Ë+)    uction frR°dONLNdπ›+Ër)%om immediate r>û°dONLNd«›rË)G"equests (which the Device Manager .°dONLNdÈÈñÙ (Òñnever adds to the queue) and fr¿°dONLNdÈ!Ùi)ãom incomplete r]‡°dONLNdÈiÙ)H%equests that the driver is executing °dONLNd<ıñ∏(˝ñasynchr$ °dONLNdCıπ%)#onously (which should rİdONLNdZı%)l5emain in the queue until the driver completes them). °dONLNdèñ ⁄(    ñThe driver subr%¿°dONLNdû€ )E    outines rÍ °dONLNdß &)&    eturn a rÜ@°dONLNd∞' ¡)&&esult code of 1 to indicate that the r=¿°dONLNd÷¬ ˝)õequest is still °dONLNdÊ
  5557. ñ…(ñ incomplete.
  5558. °dONLNdÚ!ä(è('än
  5559. .°dONLNdÙñ*Î) By jumping to the °dONLNdÎ*)UIODone°dONLNd *)$ rR`°dONLNd*T)outine. This r$¿°dONLNdT*›)>outine, described in detail on $¿°dONLNd;›*˛)âpage 2-$¿°dONLNdB˛*)!38$¿°dONLNdD*)
  5560. , .°dONLNdF+ñ6N(3ñ*indicates to the Device Manager that the rÊ@°dONLNdp+N6)∏'equest is complete. The Device Manager ˇˇ¯U°dONLNdó7ñB≠(?ñwill rÕu°dONLNdù7≠B·) emove the r„°dONLNd®7·B)4    equest fr'î°dONLNd±7BJ)'om the driver r’≥°dONLNd¿7JBÙ)B&equest queue and call the completion rE1°dONLNdÊ7ıB)´outine. °dONLNdÔIäTí(Qä;The next few sections discuss how to write your driver subrä`°dONLNd*IíT¥(Qíoutines.
  5561. rHy4sHy tät
  5562. ˇ·ˇ‚7^
  5563. °dONLNd3eärñ(oäWú¿°dONLNd4eïr9) riting the Open and Close SubrG@°dONLNdRe:r`)•outinesˇˇˇˇˇˇ)÷2
  5564. °dONLNdZzäÖê(ÇäY@İdONLNd[zêÖ¿)
  5565. ou must prfi¿°dONLNdez¿Ö.)0ovide both an Open subr¥@°dONLNd|z.Öñ)noutine and a Close subr°dONLNdìzñÖˆ)houtine for your driver†°dONLNd©z˜Ö)a. The °dONLNdØÜäë;(éä&Device Manager always executes these r °dONLNd’Ü<ëà)≤outines as synchrr†°dONLNdÊÜàë©)Lonous r∏ °dONLNdÌÜ©ëı)!equests and they .°dONLNd˛íäù∞(öäshould rR`°dONLNd    í∞ù)&eturn by means of an R`°dONLNd    ëù#)aRTSR`°dONLNd    í#ù;) instr>`°dONLNd    $í;ùY)uction..°dONLNd    ,§äØê(¨äY@İdONLNd    -§êØ¿)
  5566. our Open rÌ¿°dONLNd    7§¿Ø¿)0;outine must allocate any private storage that your driver rp°dONLNd    r§¡Øÿ(¨¡equirá@°dONLNd    w§ÿØ) es and stor4‡°dONLNd    Ç§Ø)0e .°dONLNd    Ñ∞äª(∏ä a handle to this storage in the °dONLNd    §Øª^)í dCtlStorage°dONLNd    Ø∞^ªh)B fi°dONLNd    ≤∞hª–)
  5567. eld of the device contrR`°dONLNd    …∞–ªÙ)hol entry6†°dONLNd    —∞Ûª˘)#. ˇfi@ˇ ˇˇˇˇ@
  5568. ˇ·ˇ‚7^
  5569. 4*\˜, Palatino
  5570. .+l"CHAPTER œ´)\2,     Helvetica
  5571.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5572. (‡*2 )-c)12
  5573.     )9W’ê)riting a Device Driver
  5574. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5575. 1/91(¯l Second line.4^*¿¯
  5576. °dONLNd]lh¿(elPAfter allocating private storage, you should initialize it and do any further pr†°dONLNdP]¡hÌ(e¡
  5577. eparation °dONLNdZilto(qlrE°dONLNd[iptá)equir\@°dONLNd`iát‘)ed by your driverr†°dONLNdqi‘t÷)M.°dONLNds{lÜr(ÉlY@İdONLNdt{rÜÁ)ou might also install interrX °dONLNdê{ÁÜ_)uupt handlers, change interrF†°dONLNd´{_Üπ)xupt vectors, and stor‡°dONLNd¿{∫܈)[e a pointer to °dONLNdœálí≤(èlthe device contr…¿°dONLNdflá≤í)Fol entry somewher燰dONLNdáíâ)S!e in local storage for the interr8`°dONLNdáäí˜)Öupt handlers to use. The °dONLNd*ìlûç(õlsection ËİdONLNd2ìçû“)!“Handling I/O CİdONLNd@ì”û¯)FAsynchrƇ°dONLNdGì¯ûP)%onously” on page 2-úİdONLNdZìQû[)Y17úİdONLNd\ì[û°)
  5578.  discusses interrl†°dONLNdmì¢ûÈ)Gupt handling in °dONLNd}ül™~(ßlmoréİdONLNdÄü~™†)    e detail.°dONLNdä±lº¬(πlThe DrvrDispatch r≤@°dONLNdú±¬ºÎ)V
  5579. outine in Æ`°dONLNd¶±Ïº)* Listing 2-3N†°dONLNd±±º!)/ r솰dONLNd≥±!ºS) eturns the rJ °dONLNdø±Tº‘)3esult codes of the driver subrõİdONLNd›±‘ºˆ)Äoutines °dONLNdÂΩl»{(≈lin r~¿°dONLNdÈΩ{»÷)egister D0. However≈`°dONLNd¸Ω’»˜)Z, upon rZİdONLNdΩ¯»)#eturn fr Ä°dONLNd Ω»h)!om the Open subr{ °dONLNdΩi»Â)Poutine, the Device Manager °dONLNd7…l‘Ç(—lsets rK°dONLNd=…É‘Ÿ)egister D0 to 0; ther_@°dONLNdR…Ÿ‘Í)Vefor∑@°dONLNdV…Í‘*)e, your Open rΩ@°dONLNdd…*‘ó)@outine should place the rUİdONLNd}…ò‘‚)nesult code in the ,
  5580. Courier.°dONLNdè‘l‡ú(›lioResult°dONLNdó’ú‡£)0 fPİdONLNdô’£‡))ield of the parameter block. ˇˇÉÀ°dONLNd∑ÁlÚõ(Ôl Listing 2-4À°dONLNd¬ÁúÚ)0 shows a sample Open subri"°dONLNd€ÁÚ6)youtine, ˇˇñḬ̈dONLNd„Ê6Úf)!DRVROpenˇˇÉÀḬ̈dONLNdÎÁfÚÄ)0. The ˇˇñÙɰdONLNdÒÊÄÚ∞)DRVROpenˇˇÉÀÙɰdONLNd˘Á∞Ú˜)0 function begins .°dONLNd
  5581. Ûl˛∞(˚lby setting the fl’ °dONLNdÛ∞˛)Dags of the device contr¥`°dONLNd2Û˛K)col entry (see İdONLNd@ÛL˛´)9Listing 2-2 on page 2-+`°dONLNdVÛ´˛∞)_9+`°dONLNdWÛ∞˛Û)) and checking ˇ˛Ld.°dONLNdfˇl
  5582. ‹(lwhether the driver is alrÉ°dONLNdˇ‹
  5583. ù)p,eady open (by examining the contents of the ˇ¸ò»Á°dONLNd´˛ù
  5584. fl)¡ dCtlStorageˇ˛LdÁ°dONLNd∂ˇfl
  5585. Á)B fi3t°dONLNdπˇË
  5586. ¯)    eld ˇˇ„Ú°dONLNdΩ l¡(lof the device contr˛6°dONLNd– ¡V)U#ol entry). If the driver is not alr 4°dONLNdÛ Wû)ñeady open, the ˇˇ«‰∏
  5587. °dONLNd
  5588. ûŒ)GDRVROpenˇˇ„Ú∏
  5589. °dONLNd
  5590.  Œ˜)0
  5591.  function .°dONLNdl"Í(lXallocates memory for private storage. The private storage of the driver in this example ˇ˛≠¥.°dONLNdl#l.¨* contains two fi€h°dONLNd{#¨.’)@
  5592. elds: the ˇ˝[h6–°dONLNdÖ"÷.)*numBeepsˇ˛≠¥6–°dONLNdç#.)0 fi‰Ñ°dONLNdê#./)eld stordò°dONLNdò#0.)"es a value of type ˇ˝[h…°dONLNd´".©)OLongIntˇ˛≠¥…°dONLNd≤#©.“)*
  5593. , and the ˇ˝[h“8°dONLNdº"“.ˆ))bufferˇ˛≠¥“8°dONLNd¬#ˆ.˜)$ .°dONLNd√/l:r(7lfiå¿°dONLNd≈/r:ì)eld storî`°dONLNdÕ/ì:¥)!es a bufP°dONLNd’/µ:I)""fer of 255 bytes. The Prime, Contr,İdONLNd˜/I:õ)îol, and Status subr‡°dONLNd
  5594. /õ:ˆ)Routines described in °dONLNd;lF¸(Cl!the next two sections use these fiñ@°dONLNdA;¸F)êelds.ˇ˛æƒ.°dONLNdGMlXá(UlIf the ˇ˝}à˝à°dONLNdNLáX∑)DRVROpenˇ˛æƒ˝à°dONLNdVM∑Xµ)0< function fails to allocate memory for private storage, it rCê°dONLNdíM∂X¯)ˇeturns with an ˇˇØ°dONLNd°Yldï(al    openErr ru°dONLNd™Yñd›)*esult code. The ˇˇ^*¥°dONLNd∫X›d%)G DRVRDispatchˇˇØ¥°dONLNdΔY%d+)H rê)°dONLNd»Y+dM)outine rû°dONLNd–YNdÖ)#
  5595. eturns this rB(°dONLNd›YÖdƒ)7esult code in r!«°dONLNdÏYƒd¯)? egister D0, .°dONLNd¯elp°(ml which notifi–¿°dONLNde°pˆ)5Mes the Device Manager that the driver did not open. If the memory allocation ˇˇ˜.°dONLNdQql|©(ylsucceeds, the ˇˇ·ÓaÓ°dONLNd_p™|⁄)>DRVROpenˇˇ˜aÓ°dONLNdgq⁄|,)0 function places a ˇˇ·Ó% °dONLNdzp-|K)SnoErrˇˇ˜% °dONLNdqK|Q) rÈ!°dONLNdÅqQ|ü)esult code in the ˇˇ·Ó¨˝°dONLNdìp†|–)OioResultˇˇ˜¨˝°dONLNdõq–|Ÿ)0 fiùÙ°dONLNdûq⁄|˜)
  5596. eld of .°dONLNd•}làΔ(Ölthe parameter block.
  5597. ™*Ư4´*≠¯"´*a
  5598. ˇ·ˇ‚7^
  5599.     °dONLNdˇˇ*# Listing 2-4°dONLNd∫†∞´,)DSample Open driver subroutine
  5600. .°dONLNdÿ∑l√Ñ(¿lTYPE°dONLNd·≈~—+MyDriverGlobals = RECORD°dONLNdˇ”êfl¿+numBeeps°dONLNd”¿fl¸)0
  5601. : LongInt;°dONLNd·êÌ¥(Íêbuffer°dONLNd ·¥ÌÍ)$    : Str255;°dONLNd.Ô~˚ñ(¯~END;°dONLNd7˝~    Í*MyDriverGlobalsPtr°dONLNdJ˝Í    \)l= ^MyDriverGlobals;°dONLNdb ~Í(~MyDriverGlobalsHdl°dONLNdu Ín)l= ^MyDriverGlobalsPtr;°dONLNdç'l3h(0l*FUNCTION DRVROpen (VAR pb: ParamBlockRec; °dONLNd¡5ÿAÄ+l VAR dce: DCtlEntry): OSErr;°dONLNdflQl]ä(ZlBEGIN°dONLNdÈ_~kÍ+DRVROpen := NoErr;°dONLNdm~yÊ*<dce.dCtlFlags := BOr(dCtlEnable + dStatEnable + dWritEnable °dONLNdH{¸áÊ+~'+ dReadEnable + dNeedLock  + dRAMBased,°dONLNd{â¸ïV*dce.dCtlFlags);°dONLNdï•~±>(Æ~ IF (dce.dCtlStorage <> NIL) THEN°dONLNdª≥êøÆ+BEGINˇ.@ˇ ˇˇˇˇ@
  5602. ˇ·ˇ‚7^
  5603. 4H\, Palatino
  5604. .+ä"CHAPTER œ´)\2,     Helvetica
  5605.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5606. ~¿(‡2
  5607. ‡)-a¿)13
  5608. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5609. 1/91(¯ä Second line.4^H¿,
  5610. Courier
  5611. .°dONLNd\¿hP(e¿{driver is already open}°dONLNdjÆv¿(sÆEND°dONLNd&xúÑ¥(ÅúELSE°dONLNd8ÜÆíí+&BEGIN {need to initialize dCtlStorage}°dONLNde¯+4dce.dCtlStorage := NewHandle(sizeof(MyDrvrGlobals));°dONLNd†¢¿Æz*IF (dce.dCtlStorage = NIL) THEN°dONLNd«∞“ºD+DRVROpen := openErr°dONLNd·æ¿ ÿ(«¿ELSE°dONLNdÌÓÿP+pb.ioResult := noErr;°dONLNd⁄ÆÊΔ(„ÆEND;°dONLNd
  5612. ËäÙ¢(ÒäEND;.°dONLNdä ê*Y@İdONLNdê –)our Close subrº°dONLNd!–  )@
  5613. outine must r‡°dONLNd.  C)<
  5614. everse the ef‡°dONLNd;C ´)7fects of your Open subr¸Ä°dONLNdR™ ⁄)g outine by r†°dONLNd]€ )1
  5615. eleasing any °dONLNdj
  5616. ä«(ä used memoryv†°dONLNdu
  5617. ΔŒ)<, r;†°dONLNdx
  5618. œ)    emoving interrT‡°dONLNdÜ
  5619. R)Bupt handlers, rÖ†°dONLNdï
  5620. R°)Aemoving any VBL˘†°dONLNd§
  5621. °µ)O or Tı‡°dONLNd©
  5622. µ
  5623. )ime Manager tasks, °dONLNdºä$°(!äand r≤ °dONLNd¡°$    )eplacing changed interr=‡°dONLNdÿ
  5624. $@)i
  5625. upt vectors. °dONLNdÊ+ä6(3äXIf you want to save any information about the operational state of the driver until the °dONLNd>7äBY* /next time the driver is opened, you should storw °dONLNdm7YB¿)œe this information in a r4°dONLNdÜ7¡B)helocatable block of .°dONLNdöCäN(Kämemory pointed to by the °dONLNd≥BNF)z dCtlStorage°dONLNdæCFNP)B fi°dONLNd¡CPN)
  5626. )eld, because the Device Manager does not .°dONLNdÍOäZ(Wädispose of the device contrRİdONLNdOZç)v!ol entry when a driver is closed.ˇˇnw.°dONLNd'aälπ(iä Listing 2-5Ów°dONLNd2aπl3)/ shows a sample Close subrÈ*°dONLNdLa3lT)zoutine, ˇ˛‹ÓW°°dONLNdT`Ulã)"    DRVRCloseˇˇnwW°°dONLNd]aãlΩ)6 . Since the ˇ˛‹Ó£°dONLNdi`ΩlÌ)2DRVROpenˇˇnw£°dONLNdqaÌl)0
  5627.  function .°dONLNd{mäxˆ(uäUfor this sample driver allocated private storage, and the driver doesn’t need to stor  °dONLNd–mˆx(uˆe any ˇˇU.°dONLNd÷yäÑ](Åä0information until the next time its opened, the ˇ˛*™*®°dONLNdx^Ñî)‘    DRVRCloseˇˇU*®°dONLNdyîÑ)6 function simply disposes the .°dONLNd-ÖäêŒ(çäprivate storage.
  5628. ≤H∂4≥Hµ"≥Ha
  5629. ˇ·ˇ‚7^
  5630.     °dONLNdˇˇ*# Listing 2-5°dONLNd>®Œ≥K)DSample Close driver subroutine
  5631. .°dONLNd]øäÀå(»ä+FUNCTION DRVRClose (VAR pb: ParamBlockRec; °dONLNdíÕˆŸ§+l  VAR dce: DCtlEntry): OSErr;°dONLNdµÈúı∫(ÚúBEGIN°dONLNd¿˜Æn+ IF (dce.dCtlStorage <> nil) THEN°dONLNdÁ¿fi+BEGIN°dONLNdÙ“Ü+DisposHandle(dce.dCtlStorage);°dONLNd!“-\*dce.dCtlStorage := nil;°dONLNd8/¿;ÿ(8¿END;°dONLNdCKÆW (TÆDRVRClose := NOErr;°dONLNd[Yúe¥(búEND;
  5632. ÜHç4ÜHå áäá
  5633. ˇ·ˇ‚7^
  5634. .°dONLNd`xäÖñ(ÇäWú¿°dONLNdaxïÖ) riting the Prime Subr°dONLNdvxÖ&)poutineˇˇˇˇˇˇ(Ç2
  5635. °dONLNd}çäòê(ïäY@İdONLNd~çêò¬) our Prime r˜°dONLNdâç¬ò?)2outine implements the I/O rÑ@°dONLNd§ç@òe)~    equests. FİdONLNd≠çfòl)&Y°dONLNdÆçlòÌ)ou can write your Prime subrdONLNd çÌò )Åoutine °dONLNd—ôä§÷(°äto execute synchr@°dONLNd‚ô◊§+)Monously or asynchrüİdONLNdÙô+§N)Tonously˚¿°dONLNd˚ôM§R)". ù`°dONLNd˝ôR§Y)Aÿ°dONLNd˛ôY§y) synchr¸ °dONLNdôy§«) onous Prime subr†°dONLNdô»§Ê)Ooutine °dONLNd•ä∞€(≠äcompletes an entirì°dONLNd.•€∞˙)Qe I/O rk@°dONLNd5•˙∞0) equest befor}¿°dONLNdA•0∞;)6e rå`°dONLNdD•;∞«) eturning to the Device Managere†°dONLNdb•«∞Ã)å. @°dONLNdd•Ã∞‹)An °dONLNdg±äº¨(πäasynchr$ °dONLNdn±≠º˚)#onous Prime subr7†°dONLNd~±˚º∞)N)outine can begin an I/O transaction but r¨ °dONLNdß±∞º)µeturn to the Device ˇé@ˇ ˇˇˇˇ@
  5636. ˇ·ˇ‚7^
  5637. 4*\˜, Palatino
  5638. .+l"CHAPTER œ´)\2,     Helvetica
  5639.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5640. (‡*2 )-c)14
  5641.     )9W’ê)riting a Device Driver
  5642. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5643. 1/91(¯l Second line.4^*¿¯
  5644. °dONLNd]lh≠(el
  5645. Manager beforq†°dONLNd
  5646. ]≠h»)Ae the r›†°dONLNd]»h|)+equest is complete. In this case, the I/O r˚†°dONLNd?]|h‡)¥equest continues to be °dONLNdViltÓ(qlexecuted, typically when mor9°dONLNdriÔtm)Ée data is available, by other rÿ°dONLNdëimtÀ)~outines such as interr1 °dONLNdßiÃt›)_upt °dONLNd´ulÄŸ(}lhandlers or completion r¨¿°dONLNd√uŸÄ3)moutines. The section –`°dONLNdÿu3Äx)Z“Handling I/O +`°dONLNdÊuyÄû)FAsynchrñ¿°dONLNdÌuûÄÓ)%onously” on page °dONLNd˛Ålåt(âl2-”‡°dONLNdÅtå~)17”‡°dONLNdÅ~å()
  5647. % discusses how to complete an asynchrR °dONLNd'Å)åw)´onous Prime subre†°dONLNd7Åwåï)Noutine.
  5648. ô*¶¯4ö*•¯
  5649. °dONLNdˇˇ(°lNOTE
  5650. ˇ·ˇ‚7^
  5651. °dONLNd?§lØ®* Notice the dif∞¿°dONLNdM§®Ø¥)<ferì@°dONLNdP§¥Ø) ence between asynchr[İdONLNdd§Ø6)aonous r°°dONLNdk§6Øl)! equests and °dONLNdw∞lªé(∏lasynchr$ °dONLNd~∞調)#
  5652. onous subr5`°dONLNdà∞¿ªÑ)1*outines. The Device Manager places asynchrW`°dONLNd≤∞Ѫ°)ƒonous °dONLNd∏ºl«o(ƒlrE°dONLNdπºp«≤)equests in the r°dONLNd…º≥«)Cequest queue and r0†°dONLNd€º«<)T eturns contrÉ@°dONLNdÁº<«ñ)5ol to the application °dONLNd˝»l”õ(–l
  5653. right awayH@°dONLNd»õ”†)/. ȇ°dONLNd    »ü”ƒ)AsynchrU@°dONLNd»≈”ˆ)&
  5654. onous subrfİdONLNd»ˆ”!)1
  5655. outines ar*‡°dONLNd$»"”ç),e capable of satisfying a °dONLNd>‘lflw(‹llar-`°dONLNdA‘xflà) ge rÀ °dONLNdE‘àflA),equest in small pieces, one piece at a time.,
  5656.  
  5657. Zapf Dingbats
  5658. M¿°dONLNdˇˇ)Ωu
  5659. °dONLNdÜÊlÒ1(Ól,The Device Manager indicates whether it is rÎ`°dONLNd≤Ê1Òú)≈equesting a Read or a W•@°dONLNd…ÊúÒË)krite operation by ˇˇÇÿ.°dONLNd€Úl˝U(˙l4placing one of the following constants in the low-ori °dONLNdÚU˝õ)Èder byte of the ,
  5660. Courierˇˇ∞tİdONLNdÒõ˝ø)FioTrapˇˇÇÿtİdONLNd%Úø˝»)$ fi˜X°dONLNd(Ú»˝˜)     eld of the .°dONLNd3˛l    ∂(lparameter block:.°dONLNdEl!ê*aRdCmd°dONLNdP¢!¥)6EQU°dONLNdUΔ!Ã)$2°dONLNd\2!»)l;Read operation requested°dONLNdw#l/ê(,laWrCmd°dONLNdÇ#¢/¥)6EQU°dONLNdá#Δ/Ã)$3°dONLNdé#2/Œ)l;Write operation requestedˇ˛ç∞°dONLNd©<lG‘(DlThe Device Manager pr˚p°dONLNdæ<‘G
  5661. )h ovides two rÈ0°dONLNd <
  5662. G4)6outines—ˇ˝`È0°dONLNd“;4GR)*Fetchˇ˛ç∞È0°dONLNd◊<RGf) and ˇ˝`ê°dONLNd‹;gGÖ)Stashˇ˛ç∞ê°dONLNd·<ÖGØ)—that prd†°dONLNdÈ<ØG¯)*ovide low-level .°dONLNd˘HlS§(Pl
  5663. support for rÛ‡°dONLNdH§SP)8'eading and writing characters to and frjİdONLNd-HQSÜ)≠ om data buf« °dONLNd8HÜS”)5fers. Use of these °dONLNdKTl_o(\lrE°dONLNdLTp_˚)!outines is optional. The section _†°dONLNdmT˚_\)ã“Routines” on page 2-†°dONLNdÇT]_g)b36†°dONLNdÑTg_≤)
  5664.  describes these r'İdONLNdñT≤_‡)K outines in °dONLNd°`lká(hldetail.ˇˇ2.°dONLNd©rl}Ä*The ˇ˛.dó2°dONLNd≠qÄ}û)Fetchˇˇ2ó2°dONLNd≤rû}≥) and ˇ˛.d≈ñ°dONLNd∑q≥}—)Stashˇˇ2≈ñ°dONLNdºr—}◊) rØ(°dONLNdær◊}-)outines update the ˇ˛.dÙæ°dONLNd—q-}i)V
  5665. ioActCountˇˇ2Ùæ°dONLNd€ri}r)< fi °dONLNdfirs}˙)
  5666. eld of the parameter block. If .°dONLNd˝~lâÕ(Ülyou do not use these r›°dONLNd~Õâ)aoutines, you ar≠ °dONLNd"~â)Be rª¿°dONLNd%~âû) esponsible for updating this fiİdONLNdD~üâ±)Öeld. ˇˇDD.°dONLNdJêlõw(òl<If your driver serves a block device, you should update the ˇ˛àànϰdONLNdÜèxõ¿(òx dCtlPositionˇˇDDnϰdONLNdíê¿õ…)H fi≥0°dONLNdïê…õ˜)     eld of the .°dONLNd†úlߢ(§l device contrl`°dONLNd¨ú¢߃)6ol entry熰dONLNd¥ú√ß»)!. .°dONLNd∑Ælπú(∂l Listing 2-4°dONLNd¬Æúπ)0 shows a sample Prime subrR`°dONLNd‹Æπ=)outine, R`°dONLNd‰≠=πs)"    DRVRPrimeR`°dONLNdÌÆsπé)6. The R`°dONLNdÛ≠éπƒ)    DRVRPrimeR`°dONLNd¸ÆƒπÓ)6
  5667.  function .°dONLNd∫l≈“(¬lallows applications to rK°dONLNd∫”≈◊)g=ead and write up to 255 bytes of data to its private data bufʰdONLNd[∫◊≈„(¬◊fer8¿°dONLNd^∫„≈Ë) . ˇˇı.°dONLNdaÃl◊Ä(‘lThe ˇˇÍu°dONLNdeÀÅ◊∑)    DRVRPrimeˇˇıu°dONLNdnÃ∑◊)6 function checks the rj°dONLNdÑÃ◊›)b-equested byte count and lowers it if it is grä‹°dONLNd±Ã›◊˜)ƒeater .°dONLNd∑ÿl„Ú(‡l than the size of the private buf†°dONLNd◊ÿÛ„ˇ)áfero`°dONLNd⁄ÿ˛„∞) (. Then, the function examines the low-orè`°dONLNdÿ∞„Ú)≤der byte of the .°dONLNd„lÔê(ÏlioTrap°dONLNd‰êÔó)$ fPİdONLNd‰óÔÓ)Gield of the parameter block to determine whether the Device Manager is .°dONLNdal˚o(¯lrE°dONLNdbp˚®)
  5668. equesting a r¿°dONLNdo©˚ )9Aead operation or a write operation. The function then moves the rÌ¿°dONLNd∞…˚Û(¯…    equested °dONLNdπ¸l§(l number of frR†°dONLNd≈¸§0)8!om its private storage to the buf¿°dONLNdʸ1Ò)ç,fer designated by the parameter block for a °dONLNdlo(lrE°dONLNdp≈)ead operation, or frP‡°dONLNd'≈()Uom the designated buf?¿°dONLNd<(Û)c2fer to its private storage for a write operation. °dONLNdnlw(l(AİdONLNdpw})  rSİdONLNdr}”)eal driver would pr}†°dONLNdÖ”L)Vobably send the data to or ré °dONLNd°Lò)yequest the data fr`°dONLNd≥ô¿)Mom a harı@°dONLNdªø÷)&dwar-°dONLNdø◊fi)e °dONLNd¡ l+((l,device, instead of storing the data itself.).°dONLNdÓ2l=Å*The °dONLNdÚ1Å=∑)    DRVRPrime°dONLNd˚2∑=3)6 function then updates the °dONLNd    13=o)|
  5669. ioActCount°dONLNd     2o=y)< fi°dONLNd    #2y=°)
  5670. eld apprR`°dONLNd    +2°=Õ)(    opriately6†°dONLNd    42Ã=œ)+.ˇB@ˇ ˇˇˇˇ@
  5671. ˇ·ˇ‚7^
  5672. 4H\, Palatino
  5673. .+ä"CHAPTER œ´)\2,     Helvetica
  5674.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5675. ~¿(‡2
  5676. ‡)-a¿)15
  5677. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5678. 1/91(¯ä Second line.4^H¿
  5679. gHj4gHj"gHa
  5680. ˇ·ˇ‚7^
  5681.     °dONLNdˇˇ(dä Listing 2-6°dONLNd\ŒgL)DSample Prime driver subroutine,
  5682. Courier
  5683. .°dONLNdsäå(|ä+FUNCTION DRVRPrime (VAR pb: ParamBlockRec; °dONLNdTňç§+l  VAR dce: DCtlEntry): OSErr;°dONLNdvèúõÆ(òúVAR°dONLNdùÆ©“+dStore°dONLNdáù“©P)$: MyDriverGlobalsHdl;°dONLNd¢´Æ∑fi(¥ÆcallType°dONLNd´´fi∑)0
  5684. : Integer;°dONLNdªπÆ≈fi(¬ÆnumBytes°dONLNdƒπfi≈)0
  5685. : LongInt;°dONLNd‘’ú·∫(fiúBEGIN°dONLNdfl„ÆÔ +DRVRPrime := NoErr;°dONLNd˙ˇÆ n* IF (dce.dCtlStorage <> nil) THEN°dONLNd!
  5686. ¿fi+BEGIN°dONLNd.“'Ê+.dStore := MyDriverGlobalsHdl(dce.dCtlStorage);°dONLNdd)“5n*numBytes := pb.ioReqCount;°dONLNdÜ7“CV*IF numBytes > 256 THEN°dONLNd•E‰QD+numBytes := 256;°dONLNdΩS“_û(\“"callType := BAND($00FF,pb.ioTrap);°dONLNdÎo“{2*CASE callType OF°dONLNd}‰â∂+#aRdCmd: BlockMove(@dStore^^.buffer,°dONLNd6ãPó‘+lpb.ioBuffer,numBytes);°dONLNdUô‰•(¢‰aWrCmd:°dONLNd]ô•ò)*BlockMove(pb.ioBuffer, °dONLNdÇß>≥Ï+0  @dStore^^.buffer,numBytes);°dONLNdßµ“¡Í(æ“END;°dONLNd≥√“œn*pb.ioActCount := numBytes;°dONLNd‘—¿›“(⁄¿END°dONLNd›flÆÎΔ(ËÆELSE°dONLNdËÌ¿˘>+DRVRPrime := mFulErr;°dONLNd˚ú¥(úEND;
  5687. (H/4(H. )ä)
  5688. ˇ·ˇ‚7^
  5689. .°dONLNdä'ñ($äWú¿°dONLNdï'Á) riting the Contr°dONLNdË'H)Sol and Status Subr|¿°dONLNd*H'n)`outinesˇˇˇˇˇˇ)»2
  5690. °dONLNd2/ä:‡(7äLike the Prime subrM@°dONLNdE/·:,)Woutine, the ContrR@°dONLNdV/,:{)Kol and Status subr∂†°dONLNdh/{:)O#outines that you write can execute °dONLNdã;äFß(Cäsynchr$ °dONLNdë;®F¸)onously or asynchr®`°dONLNd£;¸F)Tonously†°dONLNd™;F$)#. .°dONLNd≠MäX~(Uä2The Device Manager passes information to the ContrR`°dONLNdflM~Xé)Ùol r$¿°dONLNd„MéXÃ)outine in the $¿°dONLNdÒLÃX)>csCode$¿°dONLNd˜MX)$ and ˇ˛—∫°dONLNd¸Xäd¥(aäcsParamˇˇh›°dONLNdY¥d∫)* fπ]°dONLNdY∫dU)"ields of the parameter block. The ˇ˛—∫.ã°dONLNd'XVdz)úcsCodeˇˇh›.ã°dONLNd-YzdÄ)$ fg˰dONLNd/YÄd∞) ield specif°E°dONLNd:Y∞d
  5691. )0ies the type of contr°dONLNdOY d)[ol °dONLNdReäpÍ(mäinformation and the °dONLNdfdÍp)`csParam°dONLNdmep)* fi°dONLNdpep)
  5692. 7eld, which is up to 22 bytes long, contains the actual °dONLNdßqä|†(yäcontrR`°dONLNd¨q†|O)$ol information. The Device Manager r$¿°dONLNd–qO|–)Øeserves some values for the $¿°dONLNdÏp–|Ù)ÅcsCode$¿°dONLNdÚqÙ|˜)$ .°dONLNdÛ}äàH(Öä,parameter to indicate certain types of contrç¿°dONLNd}HàV)æol r0†°dONLNd#}Wà|)    equests. ˇˇãΩ.°dONLNd-èäöë(óäYï°dONLNd.èêöˆ)ou can identify these rñT°dONLNdEèˆöc)fequests by checking the ˇˇz≈H°dONLNd]écöá)mcsCodeˇˇãΩ≈H°dONLNdcèáöê)$ fiQ°dONLNdfèëö)
  5693. eld for these constant values:ˇ∂@ˇ ˇˇˇˇ@
  5694. ˇ·ˇ‚7^
  5695. 4*\˜, Palatino
  5696. .+l"CHAPTER œ´)\2,     Helvetica
  5697.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5698. (‡*2 )-c)16
  5699.     )9W’ê)riting a Device Driver
  5700. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5701. 1/91(¯l Second line.4^*¿¯
  5702.     °dONLNd]lg©(dl
  5703. Constant name¸î°dONLNd]©g∞)=VˆT°dONLNd]Øg¿)alue°dONLNd]¸g )MMeaning°dONLNd]ngp)r ,
  5704. Courier
  5705. .°dONLNd jlvú(slkillCode.°dONLNd)k®v≠)<1°dONLNd+k&vG)~KillIO r˙†°dONLNd3kGvn)!equested.°dONLNd<vlÇñ(lgoodBye.°dONLNdDw®Ç∞)<-1°dONLNdGw&Ç_)~ Heap being r¸@°dONLNdSw_Çê)9 einitialized.°dONLNd`Çléê(ãlaccRun.°dONLNdgÉ®é≤)<65°dONLNdjÉ&é,)~T °dONLNdkÉ,éí)ime for periodic action °dONLNdÑõl¶Ë(£lWhen the Device Manager rp °dONLNdùõ˶3)|eceives a KillIO rÉİdONLNdØõ3¶a)K equest, it r¶ °dONLNdªõa¶Í).emoves every parameter block °dONLNdÿßl≤s(Ølfrò‡°dONLNd⁄ßs≤µ)om the driver r^°dONLNdÈß∂≤7)Cequest queue. If your driver rİdONLNdß8≤Å)Çesponds to any r @°dONLNdßÅ≤«)Iequests asynchr4@°dONLNd&ß«≤Í)FonouslyêİdONLNd-ßÈ≤Ó)", °dONLNd/≥læ(ªl(the part of your driver that completes rİdONLNdW≥æ™)≠ equests begun by the driver subr`°dONLNdw≥™æfl)ë
  5706. outines (for °dONLNdÑøl º(«lexample, an interr‚¿°dONLNdñøº ◊)P?upt handler) might expect the parameter block for the pending rh†°dONLNd’øÿ ˜(«ÿequest °dONLNd‹Àl÷÷(”lto be at the head of the rK`°dONLNdˆÀ◊÷å)k&equest queue. The Device Manager notifiT`°dONLNdÀå÷ı)µes your driver of KillIO °dONLNd6◊l‚o(fllrE°dONLNd7◊p‚)%equests so that you can take the apprL†°dONLNd\◊‚÷)£,opriate actions to stop work on the pending °dONLNdà„lÓo(ÎlrE°dONLNdâ„pÓë)equest.  @°dONLNdë„ëÓó)!Yä¿°dONLNdí„óÓ )ou should be certain you ra °dONLNd¨„ Ó<)t eturn contrv¿°dONLNd∑„<ÓÚ)1(ol to the Device Manager by means of an .°dONLNdflÓl˙~(˜lRTS°dONLNd‚Ô~˙ñ) instrl°dONLNdËÔñ˙,)!uction and not by jumping to the l°dONLNd    Ó,˙P)ñIODonel°dONLNdÔP˙W)$ r>`°dONLNdÔW˙v)outine.ˇˇ∫U°dONLNdl ´(    lIf you set the ˇˇt™iT°dONLNd(¨ Ù)@ dNeedGoodbyeˇˇ∫UiT°dONLNd4Ù ˝)H fl#©°dONLNd7˛ *)
  5707.  
  5708. ag in the ˇˇt™R®°dONLNdA* `),    drvrFlagsˇˇ∫UR®°dONLNdJ` s)6 worfl]°dONLNdNs fl)d of your device header Q°dONLNde‡ ¯)m, the ˇˇO®°dONLNdk
  5709. l(l#Device Manager will call your Contr‡®°dONLNdé
  5710. !)¶ol r∞°dONLNdí
  5711. "à)outine with the value ˇ˛üPAP°dONLNd® à≤)fgoodByeˇˇO®AP°dONLNdØ
  5712. ≤—)* in the ˇ˛üP0H°dONLNd∑ “ˆ) csCodeˇˇO®0H°dONLNdΩ
  5713. ˆ¯)$ .°dONLNdæl$≥(!lparameter beforp†°dONLNdÕ≥$)Ge the heap is rü °dONLNd‹$&)=einitialized. æ °dONLNdÍ&$,)6Y~†°dONLNdÎ,$O)ou can r‡°dONLNdÛP$Ò)$"espond by performing any clean-up °dONLNd%l0—(-lactions necessary beforO °dONLNd,%“0ı)fe heap rz‡°dONLNd4%ı04)#einitialization.ˇ˛Æ∞.°dONLNdE7lBß(?lIf you set the ˇ˝]`:¿°dONLNdT6®Bfi)<    dNeedTimeˇ˛Æ∞:¿°dONLNd]7fiBÊ)6 flÈp°dONLNd`7ÊB)
  5714. ag in the ˇ˝]`ıİdONLNdj6BE))    drvrFlagsˇ˛Æ∞ıİdONLNds7EBW)6 worvê°dONLNdw7XB¿)d of your device headers°dONLNdé7¿B¯)h
  5715. , the Device ˇ˛òðdONLNdõClNÌ(KlManager will call your Contrµê°dONLNd∑CÌN˚)Åol r º°dONLNdªC¸N_)outine with the value ˇ˝1òÉϰdONLNd—B_NÉ)caccRunˇ˛òÃÉϰdONLNd◊CÉN†)$ in the ˇ˝1òNP°dONLNdflB°N≈)csCodeˇ˛òÃNP°dONLNdÂC≈N¯)$  parameter .°dONLNdOlZ†(Wl periodicallyT¿°dONLNd¸O†Z•)4. ˇˇ·.°dONLNdˇalls(ilYï°dONLNdarlØ)ou can interprk"°dONLNdaØl)=et other values of the ˇ˛¬tá°dONLNd%`l6)ccsCodeˇˇ·tá°dONLNd+a6l?)$ fivh°dONLNd.a?lº)    eld as suited for your driver¬m°dONLNdKaªl¿)|. ñưdONLNdMa¿l«)Y´Æ°dONLNdNaΔlÔ)    our ContrÔ°dONLNdWaÔl˙))ol .°dONLNdZmlxo(ulrE°dONLNd[mpx˜)outine should accept this contr¸¿°dONLNdzm˜x¿)á-ol information and manipulate the device as rõ¿°dONLNdßm¡xÎ)     equested..°dONLNd±läú(ál Listing 2-7°dONLNdºúä)0 shows a sample ContrR`°dONLNd—ä")hol subr$¿°dONLNdÿ"äD)outine, $¿°dONLNd‡~DäÜ)" DRVRControl$¿°dONLNdÎÜä°)B. The $¿°dONLNdÒ~°ä„) DRVRControl$¿°dONLNd¸„äÊ)B .°dONLNd˝ãlñΩ(ìlNfunction allows applications to specify a number of times for the driver to pr    `°dONLNdKãæñ‚(ìæoduce a °dONLNdSól¢È(ülsystem beep. The driver stor’°dONLNdoóÈ¢)}es the r~°dONLNdwó    ¢µ) 'equested number in its private storage..°dONLNdü©l¥Å(±lThe °dONLNd£®Å¥√) DRVRControl°dONLNdÆ©√¥
  5716. )B function interprR`°dONLNdø©
  5717. ¥J)J
  5718. ets the value.°dONLNdÕªlΔë(√lCONST ¢@°dONLNd◊ªëΔØ)%beepIt ‡ °dONLNd‡ªØΔ…)= 100;.°dONLNdÁÕlÿx(’lin °dONLNdÍÃxÿ¥)
  5719. the csCode°dONLNdÙÕ¥ÿæ)< fi°dONLNd˜Õæÿ)
  5720. eld to indicate a rR`°dONLNd
  5721. ÕÿÇ)Tequest for system beeps. $¿°dONLNd#ÕÇÿâ)pY9¿°dONLNd$ÕàÿΔ) ou would defi9¿°dONLNd1ÕΔÿÈ)>ne this .°dONLNd9Ÿl‰Ë(·lconstant in the constant defiù¿°dONLNdVŸË‰n)| nition part of your Pascal unit.ˇˇùá.°dONLNdwÎlˆÄ(ÛlThe ˇˇ;á°dONLNd{Íň√) DRVRControlˇˇùáá°dONLNdÜÎ√ˆ+)B function examines the ˇˇ;죰dONLNdùÍ+ˆO)hcsCodeˇˇùá죰dONLNd£ÎOˆX)$ fi1*°dONLNd¶ÎYˆ¯)
  5722. #eld of the parameter block for the ˇˇa¸°dONLNd…ˆlê(ˇlbeepItˇˇ∞˛°dONLNdœ˜êÀ)$ value. If it fx°dONLNdfi˜Ãè)<+inds this value, the function examines the ˇˇa¸Îj°dONLNd    ˆèπ)√csParamˇˇ∞˛Îj°dONLNd˜πø)* fl˰dONLNd˜¿¯)
  5723. ield for the .°dONLNdlº( lnumber of beeps rÿ¿°dONLNd0º˘)Pequested, stor*‡°dONLNd>˙)>es the r”‡°dONLNdFŒ)(equested number in private storage, and °dONLNdnlu(lprG °dONLNdpvÂ)
  5724. oduces the system beeps.ˇé@ˇ ˇˇˇˇ@
  5725. ˇ·ˇ‚7^
  5726. 4H\, Palatino
  5727. .+ä"CHAPTER œ´)\2,     Helvetica
  5728.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5729. ~¿(‡2
  5730. ‡)-a¿)17
  5731. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5732. 1/91(¯ä Second line.4^H¿
  5733. gHj4gHj"gHa
  5734. ˇ·ˇ‚7^
  5735.     °dONLNdˇˇ(dä Listing 2-7°dONLNd\Œg8)DSample Control subroutine,
  5736. Courier
  5737. .°dONLNdsäò(|ä-FUNCTION DRVRControl (VAR pb: ParamBlockRec; °dONLNdRÅç∞+~ VAR dce: DCtlEntry): OSErr;°dONLNdsèúõÆ(òúVAR°dONLNd|ùÆ©“+dStore°dONLNdÑù“©P)$: MyDriverGlobalsHdl;°dONLNdü´Æ∑‰(¥Æ    beepTimes°dONLNd©´‰∑ )6
  5738. : Integer;°dONLNdª«ú”∫(–úBEGIN°dONLNdΔ’Æ·n+ IF (dce.dCtlStorage <> nil) THEN°dONLNd„¿Ôfi+BEGIN°dONLNd˝Ò“˝Ê+.dStore := MyDriverGlobalsHdl(dce.dCtlStorage);°dONLNd7
  5739. “8*CASE pb.csCode OF°dONLNdQ‰'2+
  5740. beepIt: BEGIN°dONLNdh)ˆ5ò+beepTimes := pb.csParam[0];°dONLNdç7ˆC*0dStore^^.numBeeps:= dStore^^.numBeeps+beepTimes;°dONLNd«EˆQ*REPEAT°dONLNdÿS_J+ SysBeep(1);°dONLNdÓam™*beepTimes := beepTimes - 1;°dONLNdoˆ{z(xˆUNTIL (beepTimes = 0);°dONLNd2}‰â¸(܉END;°dONLNd>ã“óÍ(î“END;°dONLNdJô“•P*DRVRControl := NoErr;°dONLNdfß¿≥ÿ(∞¿END;°dONLNdoµú¡∫(æúEND; .°dONLNduŒäŸŒ(÷äThe Status subr’ °dONLNdÑŒŒŸ})D&outine should work in a similar manner·°dONLNd™Œ}Ÿ)Ø. The Device Manager uses the .°dONLNd»ŸäÂÆ(‚äcsCode°dONLNdŒ⁄Ƶ)$ fPİdONLNd–⁄µÂç)0ield to specify the type of status information r"‡°dONLNd⁄çÂ∫)ÿ
  5741. equested. ı@°dONLNd
  5742. ⁄π¿),Y
  5743. @°dONLNd ⁄¿Âı) our Status r‹†°dONLNd⁄ÙÂ)4outine .°dONLNdÊäÒ¡(Óä should be pr'İdONLNd*ʬÒ’)8epar∏@°dONLNd.Ê’ÒÒ)ed to rİdONLNd5ÊÚÒP)espond to whatever r†°dONLNdIÊPÒ|)^
  5744. equests arNİdONLNdSÊ|Òò),e appra`°dONLNdYÊòÒ)opriate for your driver and °dONLNduÚä˝ç(˙ärE°dONLNdvÚé˝9)&eturn the information in the csParam fi÷@°dONLNdùÚ9˝I)´eld..°dONLNd¢ä( äThe Device Manager does not rR`°dONLNdøM)è eserve any R`°dONLNd Mq)4csCodeR`°dONLNd–qÍ)$ values for the Status subr$¿°dONLNdÎÍ )youtine. ˇ˛Œo°dONLNdÛä¥(äHowever¬†°dONLNd˙≥4)), when the Device Manager rù+°dONLNd4Å)Åeceives a Status r⁄ÿ°dONLNd'Åø)Mequest with a ˇ˝úfiF%°dONLNd5¿‰)?csCodeˇ˛ŒoF%°dONLNd;‰)$
  5745.  value of 1, .°dONLNdHä'ñ($äit rÔ¿°dONLNdLñ') eturns a handle to the driver†@°dONLNdi'T)’s device contr‡°dONLNdxU'Å)@ ol entry frÊ¿°dONLNdÉÄ'˛)+om the unit table. The driver_@°dONLNd†'    )Ä’s °dONLNd£(ä3£(0äContrÂ@°dONLNd®(£3¡)ol subrS‡°dONLNdØ(¬3')outine never sees this rü °dONLNd«('3F)eequest.ˇˇß.°dONLNdœ:äEπ(Bä Listing 2-7'°dONLNd⁄:∫E9)0 shows a sample Status subr<¥°dONLNdı:9EZ)outine, ˇˇN„¬°dONLNd˝9ZEñ)!
  5746. DRVRStatusˇˇß„¬°dONLNd:ñE∞)<. The ˇˇN1fi°dONLNd
  5747. 9±EÌ)
  5748. DRVRStatusˇˇß1fi°dONLNd:ÌE)<
  5749.  function .°dONLNd!FäQç(NärE°dONLNd"FéQ
  5750. )eturns the number of beeps rè@°dONLNd>F
  5751. Qq)equested by the most r©Ä°dONLNdTFqQ§)d ecent Contr¶°dONLNd_F§Q≤)3ol rH‡°dONLNdcF≥Q‘)equest. °dONLNdlXäcÂ(`äThis function interpr%@°dONLNdÅXÊc)\
  5752. ets the value°dONLNdèjäuØ(räCONST ¢@°dONLNdôjØuŸ)%    getBeeps ´Ä°dONLNd§jŸuÛ)*= 100;.°dONLNd´|äáñ(Ñäin °dONLNdÆ{ñá∫) csCode°dONLNd¥|∫áƒ)$ fi°dONLNd∑|ƒá8)
  5753. eld to indicate a Status rR`°dONLNd—|8áÀ)t!equest for number of beeps last r$¿°dONLNdÚ|Àá¯)ì
  5754. equested. ˜ °dONLNd¸|˜á˛),Y  °dONLNd˝|˛á )ou .°dONLNdàäì∫(êä    would defi…‡°dONLNd
  5755. à∫ìU)0$ne this constant in the constant defiª¿°dONLNd/àVì‹)ú nition part of your Pascal unit.ˇÚ@ˇ ˇˇˇˇ@
  5756. ˇ·ˇ‚7^
  5757. 4*\˜, Palatino
  5758. .+l"CHAPTER œ´)\2,     Helvetica
  5759.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5760. (‡*2 )-c)18
  5761.     )9W’ê)riting a Device Driver
  5762. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5763. 1/91(¯l Second line.4^*¿¯
  5764. g*j¯4g*j¯"g*a
  5765. ˇ·ˇ‚7^
  5766.     °dONLNdˇˇ(dl Listing 2-8°dONLNd\∞g)DSample Status subroutine,
  5767. Courier
  5768. .°dONLNdslt(|l,FUNCTION DRVRStatus (VAR pb: ParamBlockRec; °dONLNdPÅÍçå+~VAR dce: DCtlEntry): OSErr;°dONLNdpè~õê(ò~VAR°dONLNdyùê©¥+dStore°dONLNdÄù¥©2)$: MyDriverGlobalsHdl;°dONLNdùπ~≈ú(¬~BEGIN°dONLNd®«ê”P+ IF (dce.dCtlStorage <> nil) THEN°dONLNdœ’¢·¿+BEGIN°dONLNd‹„¥Ô»+.dStore := MyDriverGlobalsHdl(dce.dCtlStorage);°dONLNdˇ¥ *CASE pb.csCode OF°dONLNd0
  5769. Δ¸+    getBeeps:°dONLNdDΔ'‰*BEGIN°dONLNdS)ÿ5™+#pb.csParam[0] := dStore^^.numBeeps;°dONLNd7ΔCfi(@ΔEND;°dONLNdãE¥QÃ(N¥END;°dONLNdñS¢_∫(\¢END;°dONLNd¢oê{(xêDRVRStatus := NoErr;°dONLNdª}~âñ(Ü~END;
  5770. ±*∑¯4±*∂¯ ±l±¯
  5771. ˇ·ˇ‚7^
  5772. ˇˇ◊.ˇ◊°dONLNd¿†l∞—(¨l
  5773. Handling I/O ä®°dONLNdÕ†—∞ )eAsynchra®°dONLNd‘† ∞C);onouslyˇˇˇˇˇˇ•)‰2
  5774. °dONLNd‹∑l¬    (øl$If you write any of your driver subr`°dONLNd∑
  5775. ¬~)ûoutines to execute asynchr©°dONLNd∑~¬°)tonously@°dONLNd!∑°¬‹)#
  5776. , you must pr2†°dONLNd.∑‹¬˜);ovide °dONLNd4√lŒ7(Àl-a mechanism for your driver to complete the r¿°dONLNda√8Œ[)Ãequests.°dONLNdj’l‡¬(›lSome examples of rò†°dONLNd|’¬‡C)Voutines that you might use ar+‡°dONLNdô’D‡K)Çe:,
  5777.  
  5778. Zapf Dingbats
  5779. °dONLNdúÈlq(Ôln
  5780. °dONLNdûÁxÚ≤) Completion rK@°dONLNd™Á≥Úÿ);    outines. ù°dONLNd≥ÁÿÚfi)%Y]İdONLNd¥ÁfiÚ!)our driver subr∂¿°dONLNd√Á!Ú˜)C3outine could call another driver to start the data °dONLNdˆÛx˛ö(˚xtransfer °dONLNd˛Ûö˛)". In this case, you can pr
  5781. İdONLNdÛ˛ß)j%ovide that driver with a completion rõ°dONLNd=Û߲ı)£outine. When the °dONLNdNˇx
  5782. Û(xother driver completes the rx°dONLNdjˇÛ
  5783. ‹){3equest, the Device Manager executes the completion °dONLNdù x{(xrE°dONLNdû |Ò)outine. In the completion rπ °dONLNdπ Òı)u=outine, you could call the other driver again to execute the °dONLNdˆx"C(x.next part of the I/O operation. When the entirßİdONLNd$C"Û)À(e operation is complete, the completion .°dONLNdL#x.|(+xrR`°dONLNdM#|.¡)outine should r$¿°dONLNd\#¡..)Eeturn by jumping to the $¿°dONLNdt"..R)mIODone$¿°dONLNdz#R.Y)$ r˜ °dONLNd|#X.w)outine.
  5784. .°dONLNdÑ7l>q(=ln
  5785. °dONLNdÜ5x@ë) Interrç °dONLNdå5ë@Œ)upt handlers. À@°dONLNdö5Œ@‘)=Yã¿°dONLNdõ5‘@’)=our driver might serve a device, such as a slot device, that °dONLNdÿAxLΩ(Ixgenerates interrΔ`°dONLNdËAΩL’)Eupts. †°dONLNdÓA’LÂ)An     @°dONLNdÒAÊL)    interrupt`°dONLNd˙ALK)) causes the pr˛‡°dONLNdAJLÚ);%ocessor to suspend normal execution, °dONLNd-MxX≥(Ux
  5786. save the addr¿°dONLNd:M¥X    )<ess of the next instr‡°dONLNdOM    XU)Uuction and the pr    Ä°dONLNd`MUXu)LocessorX`°dONLNdgMvXfl)!’s internal status on the °dONLNdÅYxd(axstack, and execute an interrİdONLNdùYÒd%)y upt handlerч°dONLNd®Y$d))3. W@°dONLNd™Y)d/)Y¿°dONLNd´Y/dW)    ou can cr @°dONLNd¥YWdë)(eate an interrI@°dONLNd¬Yëd€):upt handler that °dONLNd”expï(mx@continues an I/O operation when the device signals, by an interr˙İdONLNdeïp”(mïupt, that it is r1`°dONLNd$e‘p˜)?eady to °dONLNd,qx|£(yx
  5787. continue. ÷`°dONLNd6q£|©)+Yñ‡°dONLNd7q©|”)
  5788. our interr °dONLNdAq‘|-)+upt handler must prmİdONLNdTq-|b)Y eserve any r≈¿°dONLNd`qb|‡)5egisters it uses and clear the °dONLNd}xàã(Öxsour˛†°dONLNdÉ}ãàÀ)ce of the interrˆ@°dONLNdì}Ààfl)@upt. @°dONLNdò}‡àÊ)Y‘¿°dONLNdô}ÂàX)ou may want your Open r€†°dONLNd∞}Xàí)soutine to storè¿°dONLNdæ}ìàÂ);e a handle to your °dONLNd—âxîì(ëxdriverñ†°dONLNd◊âîî”)’s device contr@°dONLNdÊâ‘î6)@ol entry in your driverì°dONLNd˝â7î|)c’s local storage. ``°dONLNdâ}îÉ)FY ‡°dONLNdâÉîˆ)ou can get a handle to the °dONLNd+ïx†Æ(ùx device contrl`°dONLNd7ïÆ†ã)61ol entry using the GetDCtlEntry function. For mor °dONLNdhïå†ÿ)fie information on °dONLNdy°x¨¡(©xMacintosh interr¸Ä°dONLNdâ°¡¨o)I'upts and how to install your own interrÖ °dONLNd∞°p¨Œ)Øupt handlers, see the ûİdONLNdΔ°Œ¨Û)^    Guide to °dONLNdœ≠x∏Ë(µxMacintosh Family Hardwar? °dONLNdÁ≠È∏Ï)qe"¿°dONLNdË≠Ì∏) and ‡°dONLNdÌ≠∏„)4Designing Cards and Drivers for the Macintosh Family`°dONLNd!≠„∏Â)‡.ˇ#à@ˇ ˇˇˇˇ@
  5789. ˇ·ˇ‚7^
  5790. 4H\, Palatino
  5791. .+ä"CHAPTER œ´)\2,     Helvetica
  5792.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Device Driver
  5793. ~¿(‡2
  5794. ‡)-a¿)19
  5795. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5796. 1/91(¯ä Second line.4^H¿,
  5797.  
  5798. Zapf Dingbats
  5799. °dONLNd_äfè(eän
  5800. °dONLNd]ñh¥) VBL, TÉ¿°dONLNd]¥hÓ) ime Manager^`°dONLNd]Óh"): , and Deferr'İdONLNd]#h6)5ed T¬†°dONLNd#]5h)1ask Manager tasks. Installing any of these tasks °dONLNdTiñtÆ(qñensur$ °dONLNdYiØt)es that your driver rùİdONLNdnit—)X.eceives system time at some point in the futurÓ†°dONLNdúi—t) e. During this °dONLNd´uñÄr(}ñ4time, you can check to see if the I/O operation is r†°dONLNdflusÄø)›eady to continue.
  5801. çHö4éHô
  5802. °dONLNdˇˇ(ïäNOTE
  5803. ˇ·ˇ‚7^
  5804. °dONLNdÒò䣣* Interrç °dONLNd˜ò££1) upts can occur while your interr@°dONLNdò1£Ω)éupt handler is executing. When °dONLNd6§äذ(¨äAthis happens, it’s possible for the system to suspend your interr3 °dONLNdw§¢Ø≥(¨¢upt °dONLNd{∞䪑(∏ähandler for the fi    @°dONLNdç∞’ª˚)K
  5805. rst interrí@°dONLNdó∞˚ª:)&upt and then ræ¿°dONLNd•∞:ªà)?eenter your interr∑`°dONLNd∑∞àªæ)N upt handler °dONLNd√ºä«„(ƒäfor the second interr    ‡°dONLNdÿº‰«¯)Zupt. '‡°dONLNd›º¯«˛)YË`°dONLNdfiº˝«')
  5806. our interrn†°dONLNd˺(«l)+upt handler is rá¿°dONLNd¯ºl«§)Deentrant if it °dONLNd»ä”˝(–ähandles this situation corrdİdONLNd"»˝”)sectly<İdONLNd'»”). °dONLNd*⁄äÂê(‚äTµ¿°dONLNd+⁄èÂ≈) o help ensurT‡°dONLNd7⁄ΔÂ$)7e that your driver is r6†°dONLNdN⁄$Â¥)^!eentrant, your driver should stor†°dONLNdo⁄µÂº)ëe ˇ˛;.°dONLNdqÊäÒ,(Óä'a handle to its private storage in the ,
  5807. Courierˇ¸v$Xê°dONLNdòÂ-Òo)£ dCtlStorageˇ˛;Xê°dONLNd£ÊoÒw)B fi좰dONLNd¶ÊwÒ¡)eld of the device .°dONLNd∏Ú但(˙äcontr>İdONLNdΩÚ°˝√)ol entry_¿°dONLNd≈Ú¬˝°)!3, and not use memory within the driver code itself.
  5808. I°dONLNd˘Ù•¸™)„u
  5809. °dONLNd˚äe( ä2If your driver serves a device on an expansion car›Ä°dONLNd-e»)€d, you might want to rK‡°dONLNdC…˜)d
  5810. espond to o °dONLNdM˜
  5811. ).slot °dONLNdRä∑(ä
  5812. interrupts`°dONLNd\∏·). , or interrÖİdONLNdg·ù))*upts signalled by devices on expansion car˘‡°dONLNdëùˇ)ºds. When a NuBus car* °dONLNd•)cd °dONLNdßä'¸($ädevice signals a slot interrM`°dONLNd√˝'∂)s)upt, the CPU can quickly detect which carÀ°dONLNdÏ∂'¬)πd r+¿°dONLNdÔ√'˝)
  5813.  
  5814. equested the °dONLNd¸(ä3¢(0äinterr°dONLNd(£3c),upt service, but not which device on the carXİdONLNd.(c3t)¿d. T™°dONLNd2(s3) o determine which device caused °dONLNdR4ä?≥(<ä
  5815. the interrt`°dONLNd\4≥?B))!upt, the system uses a polling pr©†°dONLNd}4B?`)èocedur@‡°dONLNdÉ4a?j)e. °dONLNdáFäQ(Nä!If your driver serves a NuBus car@°dONLNd®FQz)ìd device, it should pr‡°dONLNdæFzQú)]ovide a œ`°dONLNdΔFùQ‚)#polling routineÚ¿°dONLNd’F‚QÛ)E—a °dONLNdÿRä]ç(ZärE°dONLNdŸRé]É):outine that checks if the device it serves caused the currc†°dONLNdRÉ]¨)ı
  5816. ent interrX°dONLNdR¨]))upt, and, if so, calls the °dONLNd8^äiì(fäprG °dONLNd:^îi5)
  5817. %oper driver code to handle the interr< °dONLNd_^5i)°1upt. The Slot Manager maintains a queue of these °dONLNdêjäu∞(rä    polling rV@°dONLNdôj∞u
  5818. )&outines for each slot. ÃİdONLNd∞j
  5819. u)]Yç°dONLNd±ju ):our driver can install an element in this queue using the ˇˇD.°dONLNdÎväÅÕ(~äSlot Manager rb˰dONLNd˘vÕÅÎ)Coutine ˇ˛àk,°dONLNduÎÅ-) SIntInstallˇˇDk,°dONLNd v-Å2)B. E–°dONLNd
  5820. v2Å9)YZ–°dONLNdv8Ån)
  5821. ou can also rE¸°dONLNdvnÅ)6$emove a queue element with the Slot ˇˇ°dONLNd?Çäç∏(ää    Manager roP°dONLNdHÇ∏ç÷).outine ˇ˛9‡å@°dONLNdOÅ÷ç)
  5822. SIntRemoveˇˇå@°dONLNdYÇç)<7. The chapter “The Slot Manager” in this book gives mor°dONLNdêÇç)ˇe °dONLNdíéäôÚ(ñäinformation about the °dONLNd®çÚô4)h SIntInstall°dONLNd≥é4ôK)B and °dONLNd∏çKôá)
  5823. SIntRemove°dONLNd¬éáôé)< rR`°dONLNdƒééô±)outines..°dONLNdÕ†ä´≠(®äFor mor¿°dONLNd‘†Æ´%)$e information on slot interrE‡°dONLNd†%´Î)w/upts and writing drivers for slot devices, see °dONLNd¨ä∑j(¥ä4Designing Cards and Drivers for the Macintosh Family∑ °dONLNdS¨i∑k)fl.
  5824. ›H„4›H‚ ›ä›
  5825. ˇ·ˇ‚7^
  5826. ˇˇ◊ˇ◊°dONLNdUÃä‹(ÿäInstalling the Driverˇˇˇˇˇˇ•(ÿ2
  5827. °dONLNdk„äÓ<(Îä%When you have completed your driver rΆ°dONLNdê„<ÓT)≤esour3‡°dONLNdï„UÓ˘)%ce, you have a number of options for °dONLNd∫Ôä˙(˜ä$storing it and installing the driver@°dONLNdfiÔ˙*)ï. TO°dONLNd·Ô)˙ü)
  5828. wo of the most common ar§¿°dONLNd˘Ôü˙¶)ve:
  5829. °dONLNd¸ä
  5830. è(    än
  5831. °dONLNd˛ñ Í) Storing the driver r.¿°dONLNdÎ )Uesourw°dONLNd ˙);ce in an application and having the application install it.
  5832. °dONLNdSäè(än
  5833. °dONLNdUñÍ) Storing the driver r.¿°dONLNdiÎ)Uesourw°dONLNdnu)ce in a system extension fi`°dONLNdâv˛)s!le and writing an initialization .°dONLNd™ñ*ö('ñ(°dONLNd´ö*æ)'INIT'°dONLNd±æ*…)$) rR`°dONLNd¥…*‡) esour$¿°dONLNdπ‡*%)ce to install it..°dONLNdÀ1ä<T(9ä/In either case, you need to write code to ensurQ‡°dONLNd˙1U<•)Àe your driver is pr_†°dONLNd    
  5834. 1•<)Poperly installed and °dONLNd    "=äHƒ(Eä opened befor◊†°dONLNd    .=ƒH4):e making sending it any rZ °dONLNd    G=5HZ)q    equests. `°dONLNd    P=[Ha)&Y‹‡°dONLNd    Q=`Hà)    ou can cr–`°dONLNd    Z=àHŸ)(eate a device contrí`°dONLNd    m=⁄H˛)R    ol entry ˇ˛√¬.°dONLNd    vIäTÉ(Qä;yourself and install it in the unit table and then use the ˇ˝áÑ≠°dONLNd    ±HÉTß)˘PBOpenˇ˛√¬≠°dONLNd    ∑IßT≥)$ or ˇ˝áÑ4ú°dONLNd    ªH¥T‰)
  5835. OpenSlotˇ˛√¬4ú°dONLNd    √I‰T)0
  5836.  function to °dONLNd    –Uä`(]äopen it, or you can use the °dONLNd    ÏT`A){
  5837. OpenDriver°dONLNd    ˆUA`–)<! function to install and open it..°dONLNd
  5838. gärÅ(oä<If you want to install the driver yourself, see the section x†°dONLNd
  5839. TgÇr™)¯    “Data StrY°dONLNd
  5840. ]g´r¬))ucturfi‡°dONLNd
  5841. bg¬r)es” on page 2-[ °dONLNd
  5842. pgr )?34[ °dONLNd
  5843. rg r
  5844. )
  5845.  °dONLNd
  5846. ssä~({ä"for details about the device contrҰdONLNd
  5847. ïs~k)ëol entry data type.ˇˇΩ^.°dONLNd
  5848. ©Öäê(çäIf you want to use the ˇˇzº4°dONLNd
  5849. ¿Ñê,)f
  5850. OpenDriverˇˇΩ^4°dONLNd
  5851.  Ö,ê∂)<  function to install your driver™°dONLNd
  5852. ÍÖ∂êÿ)ä, you ar2Δ°dONLNd
  5853. ÚÖŸê‰)#e r¬Ñ°dONLNd
  5854. ıÖ‰ê) esponsible .°dONLNd ëäú(ôä7for examining the unit table and changing your driver r÷@°dONLNd 7ëúó)ıesourİdONLNd <ëòú·)ce ID so that the .°dONLNd Núä®Δ(•ä
  5855. OpenDriver°dONLNd XùΔ®)<J function install your driver in an empty location in the unit table. The °dONLNd ¢®ä¥Δ(±ä
  5856. OpenDriver°dONLNd ¨©Δ¥)<H function uses the following formula to determine a drivers unit number:ˇp@ˇ ˇˇˇˇ@
  5857. ˇ·ˇ‚7^
  5858. 4*\˜, Palatino
  5859. .+l"CHAPTER œ´)\2,     Helvetica
  5860.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5861. (‡*2 )-c)20
  5862.     )9W’ê)riting a Device Driver
  5863. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5864. 1/91(¯l Second line.4^*¿¯
  5865. °dONLNdolz˘(wl!The unit table is a 256-byte nonr4@°dONLNd!o˙zm)éelocatable block of 64 fourã¿°dONLNd<omz‹)s-byte spaces that contain °dONLNdV{lÜ“(Élhandles to device contr—¿°dONLNdm{“Ü„)f@ol entries for installed drivers. If needed, the Device Manager °dONLNd≠álíÈ(èlVautomatically expands the unit table to a maximum of 128 entries. The global variable ,
  5866. Courier.°dONLNdílû®*
  5867. UTableBase°dONLNd
  5868. ì®û)< contains the base addrR`°dONLNd$ìûu)kess of the unit table. .°dONLNd<•l∞€(≠lUFor an entry in the unit table to be suitable it must be empty—that is, contain a NILQ°dONLNdë•€∞›(≠€ °dONLNdí±lºÏ(πlpointer—and it must not be rA‡°dONLNdƱ̺)Å    eserved. ê`°dONLNd∑±º)'TΔ °dONLNd∏±º;)able 2-1”†°dONLNd¿±;ºÈ)"& shows a summary list of unit numbers °dONLNdÊΩl»o(≈lrE°dONLNdÁΩp»¿)eserved for specifiΩ†°dONLNd˙Ω¿»Ú)P c purposes:
  5869. Î*Û¯4Ï*Û¯ ÔlÔ¯
  5870. ˇ·ˇ‚7^
  5871.     °dONLNdˇˇ(Èl    Table 2-1°dONLNd·™Ï    )>Reserved unit numbers °dONLNd˘lø(lUnit Number Range°dONLNd1˘–)d RefNum Range°dONLNd>˘4X)dPurpose
  5872. °dONLNdGlÄ(l0 thrÿ¿°dONLNdLÄû)ough 1©@°dONLNdRû£)1°dONLNdT–Á)2-1 thr,†°dONLNdZË)ough -12°dONLNdc4k)LSerial, Disk, ` °dONLNdqkå)7AppleT`°dONLNdwåû)!alk, °dONLNdÄ4v(4Printer Drivers°dONLNdë%l0Ö(-l12 thrÿ¿°dONLNdó%Ö0®)ough 31°dONLNdü%–0Ï)K-13 thr,†°dONLNd¶%Ì0)ough -32°dONLNdØ%40L)GDesk Ù†°dONLNd¥%L0) Accessories°dONLNd¡7lBÖ(?l32 thrÿ¿°dONLNd«7ÖB®)ough 39°dONLNdœ7–BÏ)K-33 thr,†°dONLNd÷7ÌB)ough -40°dONLNdfl74Bn)G SCSI Devices°dONLNdÌIlTÖ(Ql40 thrÿ¿°dONLNdÛIÖT®)ough 47°dONLNd˚I–TÏ)K-41 thr,†°dONLNdIÌT)ough -48°dONLNd I4T_)G    Reserved °dONLNd[lfÖ(cl48 thrÿ¿°dONLNd[Öf≠)ough 127°dONLNd%[–fÏ)K-49 thr,†°dONLNd,[Ìf)    ough -128°dONLNd6[4fò)GSlot and Other Drivers°dONLNdM~lâö(Ül Listing 2-9 @°dONLNdX~õâa)/. gives a high-level language function for sear{†°dONLNdÜ~aâ’)Δching the unit table for an °dONLNd¢älïÄ(ílapprI@°dONLNd¶äÅï$)'opriate location to install your driver√†°dONLNdÕä#ïV)¢ . The driver+°dONLNdŸäWïÖ)4
  5873. -opening r`°dONLNd„äÖï„).outine in the chapter .°dONLNd˘ñl°É(ûl;“The Device Manager” calls this function and then uses the °dONLNd4ïɰø(ûÉ
  5874. OpenDriver°dONLNd>ñø°ı)<
  5875.  function to .°dONLNdK¢l≠(™l"install and open the device driver0¿°dONLNdm¢≠)î.
  5876. Û*˜¯4Ù*ˆ¯"Ù*a
  5877. ˇ·ˇ‚7^
  5878.     °dONLNdˇˇ(Òl Listing 2-9°dONLNdoÈ∞ÙÙ)DInstalling a driver
  5879. .°dONLNdÖl t(    l,FUNCTION FindEmptySpaceInUnitTable: Integer;°dONLNd∂~ñ+TYPE°dONLNd¿ê(∫+WordPtr°dONLNd…∫(¸)* = ^Integer;°dONLNd€8~Dú(A~CONST°dONLNdÊFêRÃ+
  5880. UTableBase°dONLNdÒFÃRˆ)<= $11C;°dONLNd˛Tê`“(]ê UnitNtryCnt°dONLNd
  5881. T“`¸)B= $1D2;°dONLNdp~|ê(y~VAR°dONLNd!~êä∫+dRefNum°dONLNd*~∫äˆ)*
  5882. : Integer;°dONLNd:åêòÆ(ïêcount°dONLNdAå¥ò)$
  5883. : Integer;°dONLNdQöê¶¿(£êfoundOne°dONLNdZö¿¶¸)0
  5884. : Boolean;°dONLNdj®ê¥¢(±êdce°dONLNdp®Δ¥)6
  5885. : DCtlHandle;
  5886. \li1,Times.°dONLNdˇˇ(emU?ß°dONLNdˇˇ)n«.°dONLNdˇˇ)iı°dONLNdˇˇ)tdº°dONLNdˇˇ)Nó√°dONLNdˇˇ)uJ°dONLNdˇˇ)mfiÒ°dONLNdˇˇ)bfx°dONLNdˇˇ)e^?°dONLNdˇˇ)r
  5887.     {|°dONLNdˇˇ)1,    Symbol2_°dONLNdˇˇ(e≤-
  5888. œ>°dONLNdˇˇ)Dé°dONLNdˇˇ)r˙ °dONLNdˇˇ)iH”°dONLNdˇˇ)v@ö°dONLNdˇˇ)e8a°dONLNdˇˇ)r£à°dONLNdˇˇ)RFœ°dONLNdˇˇ)e>ñ°dONLNdˇˇ)s©Ω°dONLNdˇˇ)o1D°dONLNdˇˇ)u∏À°dONLNdˇˇ)r#Ú°dONLNdˇˇ)cπ°dONLNdˇˇ)eİdONLNdˇˇ)IÓÁ°dONLNdˇˇ)D
  5889.     óá°dONLNdˇˇ)1g°dONLNdˇˇ(e+θ°dONLNdˇˇ(eΔ(|°dONLNdˇˇ)e);|°dONLNdˇˇ(e楡fl°dONLNdˇˇ(e®=ˇD@ˇ ˇˇˇˇ@
  5890. ˇ·ˇ‚7^
  5891. 4H\, Palatino
  5892. .+ä"CHAPTER œ´)\2,     Helvetica
  5893.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê))riting a Chooser-Compatible Device Driver
  5894. ~¿(‡2
  5895. ‡)-a¿)21
  5896. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5897. 1/91(¯ä Second line.4^H¿,
  5898. Courier
  5899. .°dONLNdjúv∫(súBEGIN°dONLNdxäÑê(Åä °dONLNd xÆÑt)$!{Get negative number of entries.}°dONLNd3ÜÆít*!count := - WordPtr(UnitNtryCnt)^;°dONLNdb¢ÆÆ*dRefNum := -49;°dONLNdv¢Æ⁄)Z#{first unreserved reference number}°dONLNd°æÆ («ÆfoundOne := FALSE;°dONLNdπÃÆÿ¬*.WHILE ( (dRefNum > count) AND NOT foundOne) DO°dONLNdÓ⁄¿Êfi+BEGIN°dONLNd˚Ë“ÙÄ+dce := GetDCtlEntry(dRefNum);°dONLNd ˆ“D*IF (dce = nil) THEN°dONLNd<‰D+foundOne := TRUE°dONLNdT“Í(“ELSE°dONLNda ‰,n+dRefNum := dRefNum - 1;°dONLNd.¿:ÿ(7¿END;°dONLNdãJÆVJ(SÆIF (foundOne = FALSE) THEN°dONLNd¨X¿dfi+BEGIN°dONLNdπf“rP+{make a larger table}°dONLNd’t¿Äÿ(}¿END;°dONLNd‡êÆúŒ(ôÆ0FindEmptySpaceInUnitTable := -1 * (dRefNum + 1);°dONLNdûú™¥(ßúEND;
  5900. ÁH4ËH
  5901. H4H H
  5902. ˇ·ˇ‚7^
  5903. ˇˇ£‰.ˇÆ°dONLNdHX(HWœ°dONLNdXö))riting a Chooser-Compatible Device Driverˇˇˇˇˇˇ⁄|( 2
  5904. °dONLNdE$ä/Q(,ä-The Chooser is a desk accessory that helps pr⁄`°dONLNdr$Q/ï)«ovide a standarı`°dONLNdÅ$ï/
  5905. )Dd user interface for device °dONLNdù0ä;-(8ä'drivers. It allows device drivers to pr‘İdONLNdƒ0-;)£4ompt the user for choices such as which serial port °dONLNd¯<äG«(Däto use, which 9†°dONLNd<«GË)=AppleTχ°dONLNd <ÁGƒ) .alk zone to communicate with, and which LaserW·‡°dONLNd:<ƒGˆ)›
  5906. riter to use.°dONLNdHNäY(Vä#If your device driver can serve dif
  5907. °dONLNdkN Y,)ñferÔİdONLNdnN+YJ) ent har„@°dONLNduNJYa)dwar°dONLNdyNbYÆ)e devices or confi{İdONLNdãNÆY)Lgurations, you may °dONLNdûZäe (bäwant to use the Chooser to prŸ`°dONLNdªZ e€)Ç0ovide an interface for the user to make choices.°dONLNdÏläwê(täY@İdONLNdÌlêw¬) ou should r@°dONLNd¯l√wÔ)3
  5908. ead the prõ °dONLNdlÔw2),evious section, İdONLNdl3wµ)D“How the Device Manager W °dONLNd+lµwœ)Çorks,”ª`°dONLNd1lœw) which begins °dONLNd?xäÉó(Ääon F‡°dONLNdBxòÉ∏)page 2-u†°dONLNdIx∏ÉΩ) 3u†°dONLNdJxΩÉŸ), beforU@°dONLNdQxŸɘ)e you rÔ†°dONLNdXx˜É=)ead this section.°dONLNdjääï!(íä"This section describes the ChooserhİdONLNdåä!ïæ)ó", how it works, and how you can pr[‡°dONLNdÆäæï›)ùovide rä`°dONLNdµä›ïı)esour“†°dONLNd∫äıï)ces °dONLNdæñä°*(ûä%that set up a Chooser interface and rm@°dONLNd„ñ*°Å)†espond to actions frH@°dONLNd˜ñ۵)W om the user≤ °dONLNdñ¥°∂)3.ˇ©^@ˇ ˇˇˇˇ@
  5909. ˇ·ˇ‚7^
  5910. 4*\˜, Palatino
  5911. .+l"CHAPTER œ´)\2,     Helvetica
  5912.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  5913. (‡*2 )-c)22
  5914.     )9W’ê))riting a Chooser-Compatible Device Driver
  5915. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  5916. 1/91(¯l Second line.4^*¿¯
  5917. m*s¯4n*s¯ nln¯
  5918. ˇ·ˇ‚7^
  5919. ˇˇ◊ˇ◊°dONLNd]lm˘(ilHow the Chooser W˘=°dONLNd]¯m)åorksˇˇˇˇˇˇ•)¯2
  5920. °dONLNdtl◊(|lQThe Chooser allows users to select which devices they want to use. When the user °dONLNdgÄlã* #launches the Chooser desk accessory‰@°dONLNdäÄ
  5921. ãÅ)°, the Chooser displays the c`°dONLNd•ÄÇã–)uChooser windowưdONLNd≥Äœã—)M,†°dONLNd¥Ä“ãÚ) which °dONLNdªåló6(îl.contains lists and buttons for making device-r∞†°dONLNdÈå6ó~) elated choices. T[İdONLNd˙å~ó°)HypicallyâİdONLNdå†ó˜)", users select a type °dONLNdòl£ù(†l of device fr °dONLNd$òû£ø)2om the 7°dONLNd+òø£„)!    icon list뇰dONLNd4ò„£…)$7, then select the particular device they want to use frfi¿°dONLNdkò…£Í)Êom the °dONLNdr§lØü(¨l
  5922. device list. ⁄‡°dONLNd§üØ∞)3For Û¿°dONLNdɧ∞Ø—)AppleTß°dONLNdâ§—Ør)!&alk devices, they must also select an IİdONLNdاrØì)°AppleT¸¿°dONLNdµ§íØ¿)  alk zone frù†°dONLNd¿§¡Ø‚)/om the °dONLNd«∞lªï(∏l
  5923. zone list.ñ¿°dONLNd—∞慎))H The Chooser window can also display buttons, such as an OK button, and °dONLNdºl«(ƒl!radio buttons, such as the LaserW{`°dONLNd:º«)ïriter`°dONLNd?º«<)    ’s backgrq¿°dONLNdHº<«´)'ound printing On and Of±¿°dONLNd_º´«‘)o
  5924. f buttons.°dONLNdjŒlŸÑ(÷lFigurR¿°dONLNdoŒÑŸ;)%e 1-4 shows an example Chooser windowÆÄ°dONLNdîŒ:Ÿ?)∂. 
  5925. ¸*
  5926. ¯4˝*
  5927. ¯"˝*_
  5928. ˇ·ˇ‚7^
  5929.     °dONLNdˇˇ(˙l
  5930. Figure 2-2°dONLNdóÚÆ˝)BThe Chooser window
  5931. °dONLNd™ÿl„™(‡l
  5932. The Chooser rÕ`°dONLNd∑ÿ™„V)>(elies heavily on the List Manager for cr∫İdONLNdflÿV„Ω)¨eating, displaying, and °dONLNd˜‰lÔV(Ïl4manipulating possible user selections in this windoww°dONLNd+‰VÔ[)Í. I`°dONLNd-‰[Ôa)Y    ‡°dONLNd.‰aÔ¨)ou may want to r—@°dONLNd>‰¨Ô·)K
  5933. ead the List °dONLNdKl˚’(¯lManager chapter in the ÎİdONLNdb’˚%)iInside Macintosh: TÕİdONLNdu%˚>)PoolboxÜİdONLNd{?˚á) volume for mory‡°dONLNdäá˚≈)He information.°dONLNdôl
  5934. (
  5935. l$The Chooser does not communicate dir=İdONLNdΩ
  5936. π)Æ'ectly with device drivers; instead, it °dONLNd‰l(l#communicates with device packages. A¿°dONLNd)¶A|`°dONLNd) ¸`°dONLNd    `)device package"@°dONLNdax)F is a r冰dONLNdxê)esour‘‡°dONLNd#êÌ)ce similar to a driver °dONLNd:l%o("lrE°dONLNd;p%à)esourç@°dONLNd@à%)ce, except a device package r‡°dONLNd]%€).esponds to Chooser messages instead of Device °dONLNdã&l1ö(.l    Manager rW°dONLNdî&ö1&). equests. The device package is rı °dONLNd¥&&1—)å%esponsible for communicating the userE°dONLNdŸ&”1‹)≠’s °dONLNd‹2l=‰(:lchoices to the device driveru`°dONLNd¯2‰=Ê)x.°dONLNd˙DlO¿(LlDevice packages ar+†°dONLNd D¡OŸ)Ue stor/ °dONLNdDŸOÒ)ed in Œ@°dONLNdDÒOM)Chooser extension fi醰dONLNd,DNOZ)]lesR¿°dONLNd/D[O„)
  5937. , which the Chooser expects to °dONLNdNPl[r(Xlfiå¿°dONLNdPPr[ )#nd in the System Folder of the user¶`°dONLNdsP
  5938. [Ω)õ(’s startup disk. The Chooser extension fiâİdONLNdúPæ[˜)±le contains a °dONLNd™\lg†(dl number of r˛¿°dONLNdµ\†g∏)4esourG°dONLNd∫\πga)'ces in addition to the device package rÎİdONLNd·\agy)®esour3¿°dONLNdÊ\zg¬)ce. These other r:İdONLNd˜\¬g⁄)HesourÇ¿°dONLNd¸\⁄gÈ)ces °dONLNdhls<(pl/allow you to specify information to the chooser^`°dONLNd/h<s¡)–. For example, you can specify,
  5939.  
  5940. Zapf Dingbats
  5941. °dONLNdN|lÉq(Çln
  5942. °dONLNdPzxÖã) The ª¿°dONLNdTzãÖÍ)device list box label. Ö°dONLNdkzÎÖÕ)`5The Chooser displays this label over the device list.
  5943. °dONLNd°élïq(îln
  5944. °dONLNd£åxóË) RWhich buttons to use. The Chooser allows the device package to display up to four °dONLNdıòx£À* buttons, called the  °dONLNd    òãˇ)T Left buttonxİdONLNdòˇ£)3, the ’‡°dONLNdò£N) Right buttonj¿°dONLNd&òO£d);, the » °dONLNd,òd£≠)On radio button§@°dONLNd;òÆ£÷)J
  5945. , and the n¿°dONLNdEò◊£„))Ofx†°dONLNdGò„£È) f °dONLNdI§xØ∞(¨x radio buttonlİdONLNdU§±Ø≥)9.
  5946.  lø¯4
  5947. lø¯
  5948. 
  5949. lø¯4 k
  5950. lò4@ù@ù
  5951. lNÕÕ
  5952. ¯„ˇ˛ˆŸˆ¯ªˆ32 Ù32ˆ¯ ıÃ˛ ıÃŒˆ¯YˆUTJ™¨ıUVˆ˜àıJ¨¨Ùˆ¯(ıJ¶åÙˆ¯XıL‰lÙˆŸˆ
  5953. ¯„à䈟ˆŸˆŸˆŸˆŸˆŸˆ˘Ú@ Ä¯˙Ä˝˘Ú
  5954. @ ô0¬IGH¿¸"˚ ˘Û
  5955. ¬¢¬Jà°T˚#Ëò‡˛$˘˜‡@ ¢JÄ˚ˇ‡"¢#•˛*˘˝3@˝@˛
  5956. Ãô¬I@à ¸"æ#ı°˛ ˘˝L‡˝BÑ˛@Û"†#•˝"˘˛˜`˝Fû@Û"ûÚò˛˘˛‹‡˝NDz@Ûˆ˘˛ 3 ˝C2Úˆ˘˛U`˝K"˛AÙÄLj!˘˛ ; ˝QB0Ù†Çx¿D¸&˘˛ˇ˛¿Ç˛A$@¯ÑÇ ÄD¸'˘˛ˇ‡˛Mr˛A!TÇë@˘Änjœ:¸%˘˛„˝Œ"˛A ‘Ç
  5957. ¯ƒÇ–D(Δ¸$˘˛„¸¿˛!P¯ÄÇÃE˲¸%˘˝ˇ˝UU˛A »b ĢîǬE(¬¸ ˘˝{˝""˛ÙÄÇ‹dÔ>¸˘˝˝ÓÓ˛AÙÄǘ˘˝¸wv˛AÙÄǘ˘˝¸@
  5958. ˛êAÙÄǘ˘˝¸˛˛ê˘Äǘ˘˝˜A ëP
  5959. í˚Äǘ$˘#Ø"˛ ˛8ë\
  5960. ê˚Äǘ$˘¥°¢Ä$“Ì÷A ≥P
  5961. ê˚Äǘ ˘‚„5¿&∞    A˜Äǘ˘˛
  5962. ™ÀôÄ"`    AÙÄǘËIJ ˆÙÄǘà˛ÚAÙÄǘåpôŒ¸Ú8ıÄǘäà¶)ÚA1 ˜Äǘ䯢)»ÚAà0˜ÄǘäĶ)(ÚAàP˜Äǘäxô…ÃÚ"àP˜Äǘ˘ÚAÙÄǘ˘Û0ÙÄǘ˘ÚAÙÄǘ˘ÚAÙÄǘ˘ÚAÙÄǘ˘ÚÙÄǘ˘ÚAÙÄǘ˘ÚÙÄǘ˘ÚAÙÄǘ˘ÚAÙÄǘ˘ÚAÙÄǘ˘ÚÙÄǘ˘ÚAÙÄǘò4@Äù@ÄùNlè˘ÚÙÄǘ˘ÚAÙÄǘ˘ÚAÙÄǘ˘ÚêAÙÄǘ˘ÚÙÄǘ˘ÛAÙÄǘ˘ÚÙÄǘ˘ÚAÙÄǘ˘ÚAÙÄǘ˘ÛAÙ ÄÇ˙ÄÄĢÚÙ ÄÇ"ĢÛAÙ ÄÇ#Ëò‚ù¿˘ Û0Ù †Ç¸"¢#•†Ä˘ÙˇAÙ ÄÇ"æ#ı°ÚòÄËAÙ ÄÇ"†#•ÑÄËAÙ ÄÇ"ûÚòÚ∏¿ ËÙÄǘ ËAÙÄǘ ËÙÄǘ ËAÙÄǘ ËAÙÄǘ ËAÙÄǘ ËÙÄǘ˜ˆAÙÄǘˆ TAEQ˘ÙÄǘ˜( pTÇEv˘AÙÄǘˆ T@EQ˘AÙÄǘˆ ÙAÙÄǘˆ ÙÙÄǘ˘ÒAÙÄǘ˘Ûˇ¯ÙÄǘ˘Ùˇ¯AÙÄǘ˘ÛAÙÄǘ˘a˜
  5963. òAÙÄǘ˘Å˜8ÙÄǘ˘ÅP˘
  5964. AÙÄǘ˘Å¿˘8ÙÄǘ˘Å@¯AÙÄǘ˘˜AÙÄǘ˘Ù¯AÙÄǘ˘ÙÙÄǘ˘ÙXAÙÄǘ˘a(Ä˚8ÙÄǘ˘Én oà˚XAÙÄǘ˘ÖqHàÄ˚XAÙÄǘ˘á
  5965. àÄ˚ ÿAÙÄǘ˘ÅäàÄ˚8ÙÄǘ˘ÛAÙÄǘ˘Ù8ÙÄǘ˘Ù∏AÙÄǘ˘˝ ˘xAÙÄǘ˘ÅÄ˚∏AÙÄǘ˘Én oà˙8ÙÄǘ˘ÖrHàÄ˚XAÙÑǘ˘á
  5966. àÄ˚8ÙÄǘ˘a(àh@˚∏AÙÄǘ˘ÙXAÙÑǘ˘Ù ÿAÙàǘ˘Ù8ÙÄǘ@˛˝ ˘AÛˇÇp˜@˛
  5967. Å˚8ÚˆcáπŒ¸ÅHä˙ò@ÛˆT@≈1Åä˙@Ûˆ&W¡E?»Åàä˚ò@˝ůĸˆò4Ä¿ùÄ¿ùèl–$TE0(a(ÜfT˚˚~‡`¸ˆ    S«π/ÃÙX@˘p¸ˆ˘Ù8¸˛¸ˆ˘ÙX@˘¸    ˙@ˇ'˘a(Ä˚X@˚E¸    "@ˇ'˘Én oà˚ ÿ@˚å¸ #Ôûó¸‡&˘ÅLàê˚8¸"˙ˇ    "¢íbê&˘ÅàÄ˙@˝˙ "æıíbê&˘ÅäàÄ˚8¸!˙ "†íbê˘Ûò@˝¯ "ûıûs|ê˘ÙX@˝¯ˆ˘Ùàò@˝˛¿¸ˆ˘Ù˚˛ˇ0¸ˆ˘a&˚X@¸~‡`¸ˆ˘"£#n*j˙˚"#8˚~‡@¸ˆ˘ÖqFä˚X@Ûˆ˘áä˚X@Ûˆ˘Èé®éÓ‹˚àåÿ@Ûˆ˘Ù8Úˆ˘@Ûˆ˘Ù8Úˆ˘ˆò@Ûˆ˘    Å
  5968. @$˚@Ûˆ˘    Å A%¸ò@Ûˆ˘    Ö%∏Ç¿%¸˙0˙ˆ˘    áGÇ@%¸X@˙˚ˆ˘    aÅÉÇX¸8˙∫"Ä¢˝ˆ˘ÙX@˚∫
  5969. ˝ˆ˘ÙX@˚0BÄB˝ˆ˘Ù    ¯@Ä L˙ˆ˘ˆ8
  5970. √ 0˙ˆ˘Å
  5971. @˚@Aņ¯ˆ˘    Å ¸8¡†¯ˆ"˘ÅE@˚ ÿ@
  5972. √†Lê˝ˆ"˘    ÅÇ@ĸÿ@¸ Ãê ˛ˆ˘Ù
  5973. ò@˚Ç
  5974. ‡êP˛ˆ˘Û8˙Ç
  5975.  ì@ˆ¯ÙX@˙
  5976.  êP"ˆ¯Û˙L˙Jˆ¯Ûˇ¯ÛJˆŸ"ˆŸˆŸˆŸˆ
  5977. ¯„ˇ˛ˆÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕòÅû@ùHHQbîIJˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  5978. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  5979. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  5980.  
  5981.  
  5982.  ˛êêê@ù
  5983. lNÅÅÅ„ÅÅÅ„∂Å◊Ö◊™∂++˛+˛+++++++++˛+˛+++++++++˛+˛+++++++++˛+˛+++++++++˛+˛+++++++++++˛+++++++++++˛+++++++++++˛+++++++++++˛+++++++++++˛+++++++++++˛+◊™˛∂+VVÅ˚¨ŞVŞVÅÅVVÅÅVVÅÅVVÅÅVVŞVŞVÅÅVVÅÅVVÅÅVVÅÅVVŞVŞVÅÅVVÅÅVVÅÅVVÅÅVVŞVŞVÅÅVVÅÅVVÅÅVVÅÅVVŞ+˛+˛+˛+˛+++˛+˛+˛ ÅÅVVÅÅVVÅÅVVŞVŞVÅÅVVÅÅVVÅÅVVÅÅVVŞVŞVÅÅVVÅÅVVÅÅVVÅÅVVŞVŞVÅÅVVÅÅVVÅÅVVÅÅVVÅÅVVŞVÅÅVVÅÅVVÅÅVVÅÅVV◊™∂+˛Å¨+˛V¨ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛Å
  5984. +◊++◊+++˛+++++˛++++ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅVÅÅ◊™∂+VÅŨ+˛V¨+ÅÅV˛ÅV˛ÅVÅVÅVÅVÅV˛ÅVÅÅVVÅÅVV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅVÅVÅVÅVÅV˛ÅVÅÅVVÅÅVV˛ÅV˛ÅV˛ÅV˛Å(VÅÅ++◊++◊◊++◊+◊+◊+◊+◊+◊+◊+◊+◊◊+++ÅÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅVÅVÅV˛ÅVÅÅVVÅÅVV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅV˛ÅVÅVÅV˛ÅV˛ÅVÅÅVV˛ÅV˛ÅV˛ÅV˛ÅVÅ◊™∂    ++¨+V++¨˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛ +◊+◊+◊◊◊◊◊◊◊◊◊◊◊+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+◊™∂ ++¨++VV¨+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+◊+◊◊+◊◊◊◊◊◊◊+◊◊+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛◊™∂o++¨+¨Å¨¨+++++++++++++++++++++++++++++++++++++++++++++++++++˛◊    ◊◊+◊◊+˛◊{+◊+◊◊+◊◊++++++++++++++++++++++++++++++++++++++++++++++++++++++++◊™∂++˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛◊™g∂˘V+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+ˆV+˛V+˙V+˛V+˙V+˛V+˙V+VV◊™
  5985. ÅŪ◊™
  5986. ÅŪ◊™
  5987. ÅŪ◊™
  5988. ÅŪ◊™
  5989. ÅŪ◊™
  5990. ÅŪ◊™9Ω˝ˇé++++◊¸Å˘◊¸◊Ï◊¸◊∞◊¸ˇˇÚˇ¯ˇ‹aΩˇä+˛+◊¸V˜◊◊◊◊◊◊◊◊˝◊◊˝    ◊◊◊◊¸◊˛◊˛˛◊◊◊˛◊◊Õ◊Óˇ˛ˇÚˇ“tæˇˇàÅV+◊¸V˚◊◊˝◊◊◊˛◊¯◊◊˝
  5991. ◊◊◊◊◊˛◊˛◊◊˝◊◊◊◊…◊Óˇ˛ˇˇ˛˛ˇ¸˝ˇ˛ˇˇ˛ˇˇˇ˛˛ˇÊoæˇ¨˜◊È+V+V+◊¸V˘◊¸◊◊˛◊Ú◊◊◊◊˙◊◊˜◊ÌŒˇ˙ˇ˛ˇˇˇ˛ˇ˛ˇ˛ˇˇ˛ ˇˇˇˇˇˇˇ˛ˇÁëæˇ€ÅVVÅÅV◊⁄◊+˛+˛++◊ÍVV+VV+◊¸V˚◊◊◊◊◊◊◊◊˛◊˝◊◊˝    ◊◊◊◊¸◊˛◊˚◊˛◊¸◊Œ◊Óˇ˛ˇˇ¸ˇ˛ˇ˛˚ˇˇˇˇˇ˝¸ˇÁXæˇ‹˛VÅVÅVÅ◊◊€ ◊+V¨◊++◊Î+˛+◊¸VÖ◊Óˇ˛ˇˇˇ˙ˇ˛ˇˇ¸
  5992. ˇˇˇˇˇˇ„]æˇ·◊¨¨¸◊VÅ◊ÅVÅ◊€    ◊+◊¨+¨+˝◊Ì++VV+◊¸ÅÖ◊Óˇ˛ˇˇ˝ˇ˝˝ˇ˝ˇˇˇˇˇ˛˝ˇÁ<æˇ·◊˛¨
  5993. ÅÅV◊ÅÅVVÅÅ◊€◊+¨¨◊˛++◊Ï++++◊¸ÅÖ◊™5æˇ·◊˛¨
  5994. ÅVÅ◊ÅVÅVÅV◊€
  5995. ◊++V◊¨¨◊¨+◊̯◊¸VÖ◊™Mæˇ·◊˛¨ÅÅV◊Å◊V˛Å◊€
  5996. ◊+◊+¨V+¨++◊Ì++++◊¸Å¸◊ô◊++++◊¸◊™cæˇ·◊˛¨VVÅ◊◊VŞV◊€    ◊+◊+¨¨+˛◊Í+˛+◊¸V¸◊ô◊+V+◊¸◊˝ˇˆˇˇ˙ˇ˛ˇ˚ˇ¯ˇ⁄gæˇ‚◊fi◊Å◊+¨+˛◊˛++◊VÌ++++◊¸Å¸◊◊◊Ò◊◊◊≥◊++Å◊¸◊¸ˇˇ˜ˇ˘ˇ˛ˇ˚ˇ¯ˇ⁄Üæˇ·Ú◊›◊+◊+¨VV◊+◊¨◊+◊+Ó+˛+++◊¸Å¸◊◊˝    ◊◊◊◊◊¸◊◊◊˛◊◊ª◊+++V+◊¸◊˚ˇ˜ˇˇ˛ˇ˛ˇˇ˛ˇ˝ˇ˛ˇˇ⁄Üæˇfl◊Ş◊˛◊◊⁄◊V◊V¨¨++V¨+◊VÌ+˛+◊¸V¸◊◊¸◊◊◊◊◊¸◊¸◊◊◊π◊VV+ÅV◊¸◊˚ˇ˜ˇˇˇ¸ˇ˛ˇ˝ˇˇ˛ˇˇ˛ˇˇ⁄{æˇfi¨˛◊˛◊◊Ÿ◊◊+˛+˛+˛◊◊Î+˛+◊¸V¸◊◊˝◊◊◊˜◊˝◊˛◊π◊+V+◊¸◊˚ˇ˜ˇˇˇˇ˛ˇ˛ˇ˝ˇˇ˛˙ˇ⁄áæˇ›◊¨◊¨◊¨◊◊⁄◊˛VŞVŞVÅ˝VÓ++++◊¸V¸◊◊¸◊◊◊˝◊◊˛◊¸◊◊◊∫◊+˛Å+◊¸◊˚ˇ˜ˇˇ˝ˇˇ˛ˇˇˇˇ˛ˇˇ˝ˇ⁄cæˇ‹◊˛¨Å◊◊⁄◊++V˛+V˛+V¸+Î+˛+◊¸V¸◊ô◊+˛+◊¸◊˚ˇ˜ˇˇ˛ˇ˛ˇˇˇ˛ˇ˝ˇ¸ˇ⁄Iæˇ⁄◊˛¨◊⁄◊˛¨Å˛¨Å˛¨Å˛¨ÅÌ+˛+◊¸V¸◊ô◊˛+˛◊¸◊˚ˇ±FæˇŸ◊¨¨◊ÿ
  5997. ◊ŨŨŨŨŨŨ◊Ì++++◊¸Å¸◊ô◊++++◊¸◊˚ˇ±BæˇŸ˝◊ÿ◊+++˛+◊Ï+˛+◊¸Å¸◊ô◊˛+˛◊¸◊˚ˇ±BæˇŸ˝◊ÿÛ◊Í+++◊¸V¸◊˛◊ı◊◊Ó◊¡◊+++◊¸◊˚ˇ±næˇÁ˝+˛+˛+˛+˛+˙+¿++++◊¸Å¸◊˛◊˛◊◊¸◊◊˛◊◊◊Ò
  5998. ◊◊◊◊◊–◊++++◊¸◊˚ˇ±oæˇÁ˚++◊◊˛+◊◊+◊˘+È◊Ì◊Î+++◊¸V¸◊˛◊˚˛◊˛◊◊˛◊◊˛◊¯◊˝◊◊◊◊Õ◊+++◊¸◊˚ˇ±ëæˇÁ +◊◊+◊◊+◊+◊+◊˝+
  5999. ◊◊+◊++◊◊+È
  6000. ◊◊◊◊◊◊˛◊◊◊˛◊◊◊◊Ù++++◊¸Å¸◊˛◊˚◊¸ ◊◊◊◊◊◊◊ˆ◊˝◊◊◊◊Õ◊++˛◊¸◊˚ˇ±hæˇÁ    +◊◊+◊++◊+˛◊˛+◊◊+◊◊˛+◊◊+È    ◊◊◊◊◊◊˘◊◊˛˛◊Ù++++◊¸Å¸◊Ó◊≠◊++++◊¸◊˚ˇ±aæˇÂ++◊++◊◊◊++◊◊++◊++◊++È◊˛◊◊◊¯◊◊¸◊Û+˛+◊¸V¸◊ô◊˛+˛◊¸◊˚ˇ±\Û¸ˇˇˆˇÔˇˇ˚ˇ˚ˇÁ˛+◊++˛+˛+˛+˛+˛+º+˛+◊¸V¸◊ô◊+˛+◊¸◊˚ˇ±>Òˇ˛ˇ„ˇ˘ˇ˚ˇä++++◊¸V¸◊ô◊++++◊¸◊˚ˇ±WÒˇ˛ˇˇ˛˛ˇ˝ˇˇˇ˛ˇ˛ˇ˝ˇˇ˚ˇ¸ˇá+˛+◊¸V¸◊˛◊û◊+˛+◊¸◊˚ˇ±kÒˇ˛ˇˇˇ˛ˇ˛ˇˇˇˇ˛ˇˇˇ˛ˇˇˇ˝ˇ˛˝ˇâ+˛+◊¸V¸◊˙◊◊◊˛◊◊¨◊˛+˛◊¸◊˚ˇ±mÒˇ˛ˇˇ¸ˇ˛ˇˇ˛ˇ˛ˇˇˇ˛    ˇˇˇˇˇ˚ˇä++++◊¸Å¸◊˛◊◊◊˛◊¸◊◊≠◊++++◊¸◊˚ˇ±fÒˇ˛ˇˇˇ˙ˇˇˇˇ˛ˇˇˇ˛ˇˇ˝ˇˇ˚ˇâ++++◊¸Å¸◊˚˛◊˛◊˝◊◊≠◊++˛◊¸◊˚ˇ±mÒˇ˛ˇˇ˝ˇ˛ˇˇˇ˛ˇˇˇ˛ˇˇ˛ˇˇˇ¸ˇá+++◊¸V¸◊◊˛◊◊˛◊˝◊◊≠◊+˛+◊¸◊˚ˇ±.æˇä++++◊¸Å¸◊ô◊++++◊¸◊˚ˇ±+æˇá+˛+◊¸V¸◊ô◊+˛+◊¸◊˚ˇ±-æˇâ++++◊¸Å¸◊ô◊++˛◊¸◊˚ˇ±.æˇä+˛+++◊¸Å¸◊ô◊˛+++◊¸◊˚ˇ±-æˇâ++++◊¸Å¸◊ô◊++˛◊¸◊˚ˇ±+æˇá+˛+◊¸V¸◊ô◊+˛+◊¸◊˚ˇ±.æˇä++++◊¸V¸◊ô◊++++◊¸◊˚ˇ±+æˇá+˛+◊¸V¸◊ô◊+˛+◊¸◊˚ˇ±-æˇâ+˛+◊¸V¸◊ô◊˛+˛◊¸◊˚ˇ±.æˇä++++◊¸Å¸◊ô◊++++◊¸◊˚ˇ±-æˇâ+˛+◊¸V¸◊ô◊˛+˛◊¸◊˚ˇ±+æˇá+++◊¸V¸◊ô◊+++◊¸◊˚ˇ±.æˇä++˛+◊¸Å¸◊ô◊++++◊¸◊˚ˇ±òÅû@ÄùHHQbêIJˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  6001. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  6002. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  6003.  
  6004.  
  6005.  ˛êêê@ÄùNlè+æˇá+++◊¸V¸◊ô◊+++◊¸◊˚ˇ±-æˇâ++++◊¸Å¸◊ô◊˛+˛◊¸◊˚ˇ±.æˇä++++◊¸Å¸◊ô◊++++◊¸◊˚ˇ±-æˇâ+˛+◊¸Å¸◊ô◊˛+˛◊¸◊˚ˇ±+æˇá+˛+◊¸V¸◊ô◊+˛+◊¸◊˚ˇ±&æˇä¯◊¸V¸◊ô◊++++◊¸◊˚ˇ±+æˇá+˛+◊¸V¸◊ô◊+˛+◊¸◊˚ˇ±-æˇâ+˛+◊¸V¸◊ô◊˛+˛◊¸◊˚ˇ±.æˇä++++◊¸Å¸◊ô◊++++◊¸◊˚ˇ±FæˇâŞ+◊¸V¸◊ô◊˛+˛◊¸◊˚ˇ˜¸ˇˇÚˇ¯ˇÙˇˇ˙◊Ù@æˇàV+Å+◊¸V¸◊ô◊+˛+◊¸◊˚ˇıˇ˛ˇÚˇÍˇ¯◊Ùaæˇˇã++VÅ+◊¸Å¸◊ô◊++++◊¸◊˚ˇıˇ˛ˇˇ˛˛ˇ¸˝ˇ˛ˇˇ˛ˇˇˇ˛˛ˇ˛ˇˇ˛ˇ˛◊ıdΩˇˇâ+˛+◊¸V¸◊ô◊+˛+◊¸◊˚¯ˇ˝ˇ˛ˇˇˇ˛ˇ˛ˇ˛ˇˇ˛ ˇˇˇˇˇˇˇ˛ˇˇˇˇ¸◊ÙUº˛ˇ¯é◊¸Å¸◊ô◊++˛◊¸◊˚ˇıˇ˛ˇˇ¸ˇ˛ˇ˛˚ˇˇˇˇˇ˝¸ˇˇˇˇˇ˛◊ÙPÅ∏Ÿ◊ô◊++++◊¸◊˚ˇıˇ˛ˇˇˇ˙ˇ˛ˇˇ¸
  6006. ˇˇˇˇˇˇ˚ˇˇ˝ˇ◊ÙRÅ∏Ÿ◊ô◊++˛◊¸◊˚ˇıˇ˛ˇˇ˝ˇ˝˝ˇ˝ˇˇˇˇˇ˛˝ˇˇˇ˛ˇ˛◊◊ı Å∏V¸◊ô◊+˛+◊¸◊˚ˇ± Å∏V¸◊ô◊++++◊¸◊˚ˇ± Å∏V¸◊ô◊+˛+◊¸◊˚ˇ± Å∏V¸◊ô◊˛+˛◊¸◊˚ˇ± Å∏Ÿ◊ô◊++++◊¸◊˚ˇ± Å∏V¸◊ô◊˛+˛◊¸◊˚ˇ± Å∏V¸◊ô◊+++◊¸◊˚ˇ±&Æ◊Ë◊¶Å¸◊ô◊++++◊¸◊˚ˇ±Fß◊˘◊¸◊◊◊˛◊¸◊◊˛◊◊◊◊˛◊¿V¸◊ô◊+++◊¸◊˚ˇ±KØ◊◊¸◊˚˛◊¸◊◊◊◊¸◊◊˛◊◊˛◊◊◊øÅ¸◊ô◊++˛◊¸◊˚ˇ±Dß◊˘◊¸◊◊◊˛◊˙◊˛◊◊◊◊˛◊¿Å¸◊ô◊++++◊¸◊˚ˇ±"ß◊ìŸ◊ô◊˛+˛◊¸◊˚ˇ±"ß◊ìV¸◊ô◊+˛+◊¸◊˚ˇ±$ªˇˇÅV¸◊ô◊++++◊¸◊˚ˇ±&Ω˛ˇ˘ã◊˝V¸◊ô◊+˛+◊¸◊˚ˇ±)Ωˇ˜◊ç◊˝V¸◊ô◊˛+˛◊¸◊˚ˇ±1æˇˇ˜◊î˛++V◊◊˝Å¸◊ô◊++++◊¸◊˚ˇ±Cæˇˆ◊˝˛◊◊◊˝◊˛◊©++¨Å++V◊◊˝V¸◊ô◊˛+˛◊¸◊˚ˇ±>æˇˆ◊˘◊˚◊˛◊©+VV+Å◊◊˝V¸◊ô◊+˛+◊¸◊˚ˇ±Mæˇˆ◊˘◊˚◊˛◊˛◊˛◊◊◊◊◊π¨˝V+V◊◊˝Å¸◊ô◊++++◊¸◊˚ˇ±Iæˇˆ◊˘◊˚◊˛◊˛◊˛◊◊˛◊µVV+Å◊◊˝V¸◊ô◊+˛+◊¸◊˚ˇ±Læˇˆ◊˘◊˚◊˛◊˛◊˛◊◊◊◊∑++VV++Å◊◊˝Å¸◊ô◊++˛◊¸◊˚ˇ±6æˇˆ◊Í◊˛◊∞¸+Å◊◊˝Å¸◊ô◊˛+++◊¸◊˚ˇ±*æˇˆ◊ñ˜◊˝Å¸◊ô◊++˛◊¸◊˚ˇ±3æˇˆ◊ñ    ++V+V+V+◊◊˝V¸◊ô◊+˛+◊¸◊˚ˇ±3æˇˆ◊ñ    ++VÅ+V◊◊˝V¸◊ô◊++++◊¸◊˚ˇ±Ræˇˆ◊˝˛◊◊◊˝◊¸˛◊˝◊¸◊◊ˆ◊«    +V+VV+◊◊˝V¸◊ô◊+˛+◊¸◊˚ˇ±Tæˇˆ◊˘◊¸◊◊¯◊◊˛◊¸◊◊˛◊◊¸◊˛◊ +V+V+V+◊◊˝V¸◊ô◊˛+˛◊¸◊˚ˇ±[æˇˆ◊˘◊˝◊◊˛◊˛◊˝◊˝◊◊˛◊˛◊˛◊«    +Å+VÅ+◊◊˝Å¸◊ô◊++++◊¸◊˚ˇ±Ræˇˆ◊˘◊˝˛◊˙◊˝◊˙◊◊◊˛◊˛◊Δ+VV+V◊◊˝V¸◊ô◊˛+˛◊¸◊˚ˇ±Væˇˆ◊˘◊˚◊˙◊˝◊˛◊˛◊◊◊˛◊˛◊«˛+Å+Å+Å◊◊˝V¸◊ô◊+++◊¸◊˚ˇ±2æˇˆ◊ñ˛+V+Å+V◊◊˝Å¸◊ô◊++++◊¸◊˚ˇ±1æˇˆ◊ñ+¸+¨◊◊˝V¸◊ô◊+++◊¸◊˚ˇ±.æˇˆ◊ï˚V¨◊◊˝Å¸◊ô◊˛+˛◊¸◊˚ˇ±7æˇˆ◊fl◊π++V˛ÅV¨◊◊˝Å¸◊ô◊++++◊¸◊˚ˇ±Jæˇˆ◊˘◊˚◊˙◊˝◊˙◊ˆ◊ΔVV˛ÅV¨◊◊˝Å¸◊ô◊˛+˛◊¸◊˚ˇ±Sæˇˆ◊˘◊¸◊◊¯◊◊˛◊¸◊◊˛◊◊¸◊˛◊À+V¸+¨◊◊˝V¸◊ô◊+˛+◊¸◊˚ˇ±[æˇˆ◊˘◊˝◊◊˛◊◊¸◊˝◊◊˛◊˛◊˛◊«    +VV++VÅ◊◊˝V¸◊ô◊++Å+◊¸◊˚ˇ±Læˇˆ◊˘◊˝˛◊ı◊˙◊◊◊˛◊˛◊«¸++¨◊◊˝V¸◊ô◊+V+◊¸◊˚ˇ±Yæˇˆ◊˝˛◊◊◊˝◊˜◊◊˛◊˛◊˝◊◊◊˝◊»+˛V+VV¨◊◊˝V¸◊ô◊˛+Å◊¸◊˚ˇ±3æˇˆ◊ñ    +Å+VÅ+◊◊˝Å¸◊ô◊++Å+◊¸◊˚ˇ±2æˇˆ◊ï+VV+V◊◊˝V¸◊ô◊˛Å˛◊¸◊˚ˇ±3æˇˆ◊ñ    ++Å+ÅÅ◊◊˝V¸◊ô◊+˛+◊¸◊˝˛ˇ±;ˆ¸ˇˇ‡ˇˇ˚ˇ˚ˇˆ◊fl◊π˛+V+Å+V◊◊˝Å¸è◊¸◊˛ˇØGÙˇ˛ˇ‡ˇ˘ˇ˚ˇˆ◊˘◊˚◊˙◊˝◊˙◊Û◊     +Å+VÅ◊◊˝VÖ◊™jÙˇ˛ˇˇ˛˛ˇ˝˝ˇ˛ˇ˛ˇ˛ˇ˝ˇˇ˚ˇ¸ˇˆ◊˘◊˚◊ı◊˝◊◊˛◊˛◊◊˝◊◊À++Å+Å+Å◊◊˝ÅÖ◊™nÙˇ˛ˇˇˇ˛ˇ˚ˇˇ˛ˇˇˇˇ˛ˇ˛ˇˇˇ˝ˇ˛˝ˇˆ◊˘◊˚◊˚◊¸◊ˆ◊˛◊◊˝◊◊à   ++Å+V+Å◊◊˝ÅÖ◊™yÙˇ˛ˇˇ¸ˇ¸ˇˇ˛ˇˇ˚ˇ˛    ˇˇˇˇˇ˚ˇˆ◊˘◊˚◊ı◊˛◊˛◊˛◊˛◊◊˝◊◊À++V+Å+V◊◊˝Å‘◊◊˚˚◊˚˚◊Ã◊™òÅûÄ¿ùHHQbîIJˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  6007. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  6008. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  6009.  
  6010.  
  6011.  ˛êêêÄ¿ùèl–ÄÙˇ˛ˇˇˇ˘ˇˇ˛ˇˇˇˇ˙ˇˇ˝ˇˇ˚ˇˆ◊˝˛◊◊◊˝◊˜◊◊˛◊˝◊◊◊◊◊◊◊◊◊à   ++V+V+V+◊◊˝V“˚◊˚˚◊˚◊◊Œ◊™QÙˇ˛ˇˇ˝ˇ˛˝ˇ˛ˇˇˇ˝ˇ˛ˇˇ˛ˇˇˇ¸ˇˆ◊ñ    ++VÅ+V◊◊˝V∫˛◊œ◊™'æˇˆ◊ñ    +V+VV+◊◊˝V‘◊È˝◊œ◊™=æˇˆ◊ï+V+V+V+◊◊˝V∏◊œ◊¸ˇˇıˇ˜ˇˇ˛ˇ˜ˇˇÌjæˇˆ◊˝˛◊◊◊˝◊¸◊◊¸◊¸◊◊ˆ◊«    +Å+VÅ+◊◊˝Å ÅVVÅVˆ◊œ◊Óˇ˛ˇıˇ¯ˇˇ˛ˇ˜ˇˇÌ|æˇˆ◊˘◊¸◊◊˙◊◊◊˛◊¸◊◊˛◊◊¸◊˛◊ +VV+V◊◊˝VÀÅVÅVVı◊œ◊Óˇ˛ˇˇ˛˛ˇ¸ˇ˝˛ˇ¸ˇ˝ˇˇˇ¯ˇ˛◊ˆèæˇˆ◊˘◊˚◊¸◊◊¸◊˝◊◊◊◊˛◊˛◊◊ ˛+Å+Å+Å◊◊˝V÷◊˜VÅVVÅÒƒˇ˚ˇ˛ˇˇˇ˛ˇ˝ˇ˛ˇ˛ˇˇˇ˛ˇ˛ ˇˇˇˇˇˇ˛ˇ◊◊˜Çæˇˆ◊˘◊˚◊˙◊˝◊˙◊˛◊˛◊˛◊«˛+V+Å+V◊◊˝Å÷◊˜VVVÅV¬◊Óˇ˛ˇˇ¸ˇ˝ˇ˛¸ˇˇˇ˛ˇ˛ ˇˇˇˇˇˇ˛ˇ◊◊˜àæˇˆ◊˘◊˚◊˙◊˝◊˛◊˛◊◊◊˛◊˛◊«    ++Å+V+Å◊◊˝V÷◊˜VÅVVÅ√◊Óˇ˛ˇˇˇ˘ˇ˛ˇ¸ˇˇ˛ˇ˛ ˇˇˇˇˇˇ˛ˇ◊◊˜Væˇˆ◊ï++ÅÅ+Å◊◊˝Å÷◊±◊Óˇ˛ˇˇ˝ˇ˝˝ˇ˝ˇˇˇˇ˝ˇ˛ˇˇˇ¸ˇ◊◊˜#æˇˆ◊ñ    ++Å+V+Å◊◊˝Å÷◊±◊™êæˇˆ◊+˛+++˛+ ++++++˛+++˛+ ++++++˛+++˛+ ++++++˛+++˛+ ++++++˛+++++VÅ+V◊◊˝Å÷˛◊È◊◊Õ◊™êæˇˆ◊˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+V+V+V+◊◊˝V”È◊◊◊œ◊™îæˇˆ◊++˛◊++◊◊˛+◊++++◊◊˛++◊+˛+◊++◊◊˛+˛+˛+◊++˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+
  6012. ++VÅ+V◊◊˝V“˚◊˚˚◊˚◊◊Œ◊™ìæˇˆ◊++++◊++◊◊+++◊◊◊+˛◊U+++◊++◊◊+◊◊+◊◊+◊◊++++++++++++++++++++++++++++V+VV+◊◊˝V“˚◊˚˚◊˚◊Õ◊™Üæˇˆ◊++˛+    ◊+++◊+◊+˛◊˛+◊˛+◊+++◊++◊◊◊++◊+◊˛+◊+◊+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+    +V+V+V+◊◊˝VÖ◊™áæˇˆ◊˛+˛+◊˛+˛◊˛+++◊˛+◊˛+˛+˛+◊˛+ ◊+◊+++◊◊++˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+˛+Å+VÅ+◊◊˝ÅÖ◊™áæˇˆ◊+˛◊m+◊◊++◊+++◊◊++◊◊+◊++◊◊+◊◊+◊◊+◊◊+◊+++++++++++++++++++++++++++VV+V◊◊˝VÖ◊™bæˇˆ◊˘+˛+˛+˛+ˆ+˛+˛+˛+ˆ+˛+˛+˛+ˆ+˛+˛+˛+ˆ+˛+Å+ÅÅ◊◊˝VÖ◊™iæˇˆ◊¸+˛+˙+˛+˙+˛+˛+˛+˛+˙+˛+˙+˛+˙+˛+˛+˛+˛+ˆ+˛+V+Å+V◊◊˝ÅÖ◊™æˇˆ◊ñ    +Å+VÅ◊◊˝VÖ◊™"æˇˆ◊Ó◊©++Å+Å+Å◊◊˝ÅÖ◊™?æˇˆ◊˘◊˚◊˚◊˙◊Ù◊◊◊˘◊◊‘    ++Å+V+Å◊◊˝ÅÖ◊™@æˇˆ◊˘◊˚◊◊ˆ◊Ú◊◊◊¸◊◊◊◊’++V+Å+V◊◊˝ÅÖ◊™Sæˇˆ◊˘◊˝
  6013. ◊◊◊◊◊˚◊◊˛◊˛◊¸◊◊◊˘◊◊◊÷    ++V+V+V+◊◊˝V…◊◊ø◊™Mæˇˆ◊˘◊˝˛◊◊˛˝◊¸◊˘◊˛◊◊◊˘◊◊◊÷    ++VÅ+V◊◊˝V¿◊«◊™iæˇˆ◊˝˛◊◊◊˝◊˘◊˚◊◊¸˛◊¸◊◊◊◊˚◊◊◊÷    +V+VV+◊◊˝VÀ◊˛◊◊˛◊˛◊◊˙◊◊˛◊⁄◊™2æˇˆ◊ï+V+V+V+◊◊˝VÀ◊˛◊◊¸◊◊Ù˛◊⁄◊™6æˇˆ◊ñ    +Å+VÅ+◊◊˝Å…◊◊¸◊˝◊◊˘◊˝◊⁄◊™&æˇˆ◊ñ˜◊˝VÛ◊Ë◊Û◊◊◊¡◊™5æˇˆ◊Ó◊£Å◊◊˝VÔ◊◊˛◊˝◊◊˙◊◊Ú◊◊ø◊™Læˇˆ◊˘◊˚◊˚◊˙◊Ù◊◊◊«++¨¨++V◊◊˝ÅÙ◊◊¸◊˘◊˚◊◊◊Æ◊™Dæˇˆ◊˘◊˚◊◊ˆ◊Ú◊Ú◊”+VV+Å◊◊˝VÙ˛◊¸◊Û◊◊◊Æ◊™^æˇˇ˜◊˘◊˚◊◊˛◊◊˚◊ı◊¸◊«¨¨VV¨¨Å◊◊˝ÅÔ◊◊˛◊˝◊◊˙◊◊◊Û◊◊◊Ô◊◊◊◊™SΩˇ˜◊˘◊˚◊˘◊¸◊Ú◊◊˚◊Õ¨VV¨+Å◊◊˝ÅÏ◊’◊◊◊◊◊◊◊◊˚◊fi◊™<Ω˛ˇ˘◊ï++¨¨++V◊◊˝ÅÀ◊¸◊¸◊◊˛◊¸◊◊¸◊◊fl◊™Aªˇˇ˙◊ï˚+Å◊◊˝VÀ◊¸◊¸◊◊˛◊¸    ◊◊◊◊◊Ë˝◊˝◊◊™:≤◊ñÅÅVVŞV◊◊˝Vø◊◊˛◊¸◊◊¸◊◊Á◊˛◊˛◊™≤◊ç◊≈◊◊◊Δ◊◊◊™≤ã◊â◊˛◊◊◊™ÅÅø◊˛◊™
  6014. ÅŪ◊™
  6015. ÅŪ◊™
  6016. ÅŪ◊™∂Å◊Ö◊™ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ò4@ù@ù–lÕÕÕÕÕÕÕÕıÜ ?Ä!ˇ0˝0ıB˛b%˚ı"("(˛†" ˚ı%("H#èÀf CÜ8aéfÃú–„2@Úı%HBê<íI™@BJ
  6017. $íR£Dîi$í@ÚıEWE$íIt@BR%I"§J(íÄÚıIêE¯A í‡ÑúIEƒ®íHñÄÚıâêH AH∂ÄÑ≤K$ì$ ñŸÒı>80 ·úZ Ńà L√ƒåôfÒÔ"‡Ô"‡Ô‡ÕÕÕıÄ√Ä˝ wvËı@˛C¸""Ëı ˛E¸""(Ëı&Œ¿•7CO3`
  6018. DE(Ëı*J)@©I§íQ†
  6019. DEHËıRRB@™â(íë    DEPËı\TCÅ2íI ‚àâêËıíeJA2∂[HíàâêËı> F1ÉßZeúb8ù›8ËÌ"‰Ì" ‰Ì‚ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕı@˝ÄÂıÄ˝‰ı
  6020. ĉı i¢§”/mÇ–¿Êı     4“( $⁄i$¶Çi@Êı $íH DíI%$JÂı Ep E$äI»íÂı !I%H"I%í€(ñ@Êı sÒΔ01&·l»ôàÊ
  6021. ÙÇ˝‡
  6022. ÙÇ˝‡ ı«˝Ä·ò4@Äù@ÄùlRÕÕ ıÄpfl ı@ fl ı@@fl
  6023. ıòy˘ôh·
  6024. ı(íI    4†·
  6025. ıHíI    $@·
  6026. ıpaäíHÄ·
  6027. ıHAVÀ ·
  6028. ı80„ÑÎM‡·ÙD›Ùh›Û„∞›ÕÕÕ ı∞¸`0‚ ıê¸êH‚ıê@à‚ı    &O˚oô∞ à‚ı    "Rçí$–¡‚ı    "HâDÄ!‚ıDÖ$E!‚ı’≥QmIA ‚ı;b›ê∂1Ñ¿‚ÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕò4Ä¿ùÄ¿ùRlíÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕÕòÅû@ùHHQbê Ä˛ˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  6029. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  6030. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  6031.  
  6032.  
  6033.  ˛êêê@ù–lÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„Jùˇ˛˛ˇ˝˛ˇ˝ˇˇ˛˚ˇ˛˚ˇ¸˛ˇ˛˛ˇ‰ˇˇ˜ˇ˝ˇˇ˛˛ˇ˛ˇˇÔˇˇÿ˛ıˇˇÅ˜Gúˇ˛ˇ˝ˇ˝ˇˇ˚ˇˇ˝ˇˇ˚ˇ˛ˇ‚ˇ¯ˇˇ˛ˇ˛ˇˇˇÓˇ ˇÅ˜Búˇ˝ˇ˛ˇ˛ˇˇ¸ˇ˛ˇ˛ˇˇ˚ˇfiˇ˘ˇˇ˙ˇ˛ˇÓˇ…ˇÅ˜•ùˇ¸
  6034. ˇˇ˛ˇˇ¸ˇ˛ˇˇˇ¸ˇ˛ˇ˛ˇ˛˛ˇ˛ˇˇˇˇ˛ˇˇˇˇ˙ˇ˘˛ˇ˚ˇ˝ˇ˛ˇ˝ˇˇ˚ˇˇ˛ˇ˛ˇ˝ˇˇ˝˛ˇ˛˛ˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇˇ˛˝˛ˇ˛ ˇ˛ˇ˛ˇˇÖ´ùˇ¸
  6035. ˇˇˇˇˇ˝ˇ˝ˇˇˇ˚˝ˇˇˇˇˇˇˇˇˇˇˇ˙ˇ˙ˇˇ˙ˇ˝ˇˇˇˇ¸ˇˇ˛ˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇ˛ˇˇˇˇ˛ˇˇˇˇˇˇˇˇˇˇÖÆùˇ˝ˇ˛ˇˇˇˇ˛ˇˇ˛ˇˇ˛ˇ˚ˇˇˇˇˇˇˇˇ˛ˇˇ˙ˇ˛ˇˇ˛ˇ˙ˇ˝ˇˇˇˇ˝ˇ˚ˇˇˇ˛ˇˇ˛    ˇˇˇˇ˛ˇ˚ˇˇˇˇ˛ˇˇˇ˛ˇˇ˛ˇˇˇˇÑ¶ûˇ¸
  6036. ˛ˇˇˇˇ¸˛˛˛ˇˇ˛˛ˇ˝˛¸ˇ˝
  6037. ˇ˛ˇˇˇ˝ˇˇ˛˙˛˙˛˛ˇ˛ˇ¸ˇ˝˛ˇˇˇ˛¸ˇ¸˛ˇˇ˛ˇ˛˛˛˛˛ˇˇ˛˛˛˙˛ˇˇˇˇ˛ ˇˇˇ˛ˇ˛ˇˇ˛ˇˇÑ§ûˇ˛ˇˇ˛ˇˇˇˇ¸ˇˇ¸ˇ˚ˇ¸ˇˇˇ˛ˇˇˇˇˇ˝ˇˇ˚ˇ˜ˇ˙ˇ˝    ˇˇˇˇˇ˝"ˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˙ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇˇÉîü¸ˇ˝˛ˇˇ˛ˇ¸ˇˇ˚ˇ¸˛ˇ˝ˇˇ˛ˇ˛ˇˇˇˇ¸ˇˇ˚˛ˇ¯ˇ˚˛ˇ˛ˇˇˇˇˇ˚ˇˇ˛ˇˇˇˇˇ˝ˇˇ˛˛ˇˇˇ˛ˇ˙ˇˇ˛ˇˇˇˇˇˇˇˇˇˇ˝ˇˇÇÅÔˇ˛ˇÅÅ˙ÅÔˇ˛ˇÅÅ˙ ÅÓ˛ˇÅÅ˘ÅÅÅ„ÅÅÅ„ÅÅÅ„6ù˛ˇ˛ˇÙˇˇˇ˝ˇ˛ˇ÷ˇˇ˛
  6038. ˇˇ˛ˇˇ˛ˇˇ˛ˇˇ˝˛ˇˇÅπ.úˇ˛ˇ‚ˇ˝ˇˇ‘ˇ˝ˇ˛ˇ˛ˇ˛ˇ˝ˇˇÅ∏0úˇ˝ˇ„ˇ˛ˇˇ‘ˇ˝ˇ˛ˇ˛ˇ˛ˇ˛ˇˇÅ∏kùˇ¸ ˇ˛ˇˇ˛ˇ˛ˇ˝ˇˇ˛ˇ˛˚ˇˇ˛ˇˇˇ˛ˇˇ˛˝ˇˇ˛ˇ˛ˇˇˇˇˇˇ˛ˇ¯ˇˇ˛˛˛˛˛˛˛ˇˇˇÅ∏mùˇ¸ ˇˇˇˇˇˇ˛ˇˇˇˇ˚#ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇ¯ˇˇˇ˛ˇ˛ˇ˛ˇˇˇˇÅ∏iùˇ˝ˇˇˇˇˇˇˇ˝ˇˇ˚ˇˇˇˇˇ˛ˇˇˇˇ˛ ˇˇˇˇˇ˛ˇıˇˇˇ˛ˇ˛ˇ˛ˇˇˇˇÅ∑gû˛¸ˇ˛ˇˇ˛ˇ˛ˇ˛ˇ˝ˇ˛ˇ˚˛ˇ˛ˇˇ˛ˇˇˇ˛˝ˇˇ˛ˇ˛ˇı˛˛˛ˇ˛ˇ˛ˇ˛ˇ˛ˇ˛Å∑lûˇ˛ˇˇˇˇˇˇˇˇˇˇˇˇ¸ˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇıˇ˝ˇ˛ˇ˛ˇ˛ˇˇˇˇÅ∑iü¸ˇ¸ˇˇ˛ˇ˛ˇˇ˛ˇˇ˛ˇˇ¸˛ˇˇ˛ˇˇˇˇˇˇˇˇˇˇ˛ˇ˛ˇˇ˛ˇ˝ˇ˚˛ˇ˛ˇ˛ˇ˛ˇ˛ˇˇ˛ˇÅ∏Åflˇ˛ˇıˇÅóÅflˇ˛ˇˆˇÅñ
  6039. Åfi˛ˇÅâÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„öˇÛˇˇÙ˛ˇˇ’˛ˇÅúõˇ˛Ú˛ıˇ˛ˇ”˛ÅõõˇˇÚˇˆˇ˝ˇ‰ˇÒˇÅõXú
  6040. ˇˇˇˇˇˇˇˇ˛ˇ˝ˇˇ˚ˇ˙ˇˇˇˇˇˇˇˇˇˇˇˇ˝ˇˇˇˇˇˇˇ¸ˇˇˇˇ˝ˇˇÅ•]ùˇˇˇˇ˛ˇ˛ˇˇ˛ˇˇ¸ˇ˙&ˇ˛ˇ˛ˇˇˇ˛ˇˇˇˇ˛ˇˇ˛ˇˇ¸ ˇ˛ˇˇˇ˛Å•Vû¸ˇˇˇˇˇˇˇˇ¸ˇ˚ˇ˛ ˇˇˇˇˇˇˇˇˇˇˇˇ˘ˇˇˇˇÅ¢Vûˇ˛ˇˇ˛ˇˇ˛ˇˇ˛˛ˇ˚ˇ˚ˇ˛ ˇˇˇˇˇ˛
  6041. ˇˇˇˇ˛ˇˇ˘    ˇˇˇˇÅ¢_üˇ˝˛ˇˇ˛ˇˇ˛ˇˇ¸ˇ˛&ˇˇˇ˛ˇˇ˛ˇ˛ˇˇˇ˛ˇˇ˛ˇˇ˘ ˇˇ˛ˇˇˇÅ•V†˛ˇ˚ˇ˛˛ˇ˛ˇˇ˛ˇˇ˙˛ˇ˝ˇˇ˛ˇˇˇˇ˛ˇ˝
  6042. ˇˇˇˇˇˇˇˇ˙˛ˇ    ˇˇˇˇˇ˛ˇÅ®ôˇ¸ˇŸˇÅÅ˚ôˇ¸ˇŸˇÅÅ˚ö˛ˇ˛˛ˇ€˛ˇÅŸòÅû@ÄùHHQbî!IJˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  6043. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  6044. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  6045.  
  6046.  
  6047.  ˛êêê@ÄùlRÅÅÅ„ÅÅÅ„ù¸ˇÂ˛ˇ˛ˇÅÅÔúˇ˛ˇÂˇ˛ˇÅÅÓú˛˛˛Âˇ˛ÅÅÌ6ùˇ˛ˇˇˇ˝˝ˇ˚ˇˇ¸ˇˇˇˇˇˇˇˇ˛˝ˇÅŎ9ù˝ˇˇˇ˛ˇˇˇˇˇˇ¸˛ˇ˝ˇˇˇˇˇˇˇÅŞ;ùˇ˝ˇˇ˛ˇ˛ˇˇˇ˛¸ˇ˛˝    ˇ˛ˇˇ˛ˇÅÅ˝6ûˇ¸˛ˇ¸ˇˇ˝ˇˇ˛ˇˇ¸ˇ˛ ˇˇˇˇˇ˛ˇÅŸ7ûˇ¸ˇˇ˝ˇ¸ˇ¸ˇˇ¸ˇ˝ˇˇˇˇˇˇˇˇˇˇÅŞ8ü˛ˇ¸ˇˇ˝ˇ˛ˇ˛˛ˇ˝˛¸ˇˇ˛ˇ˛ˇˇˇˇ˛ˇ˛ˇˇ˛ˇÅŞíˇ˛ˇˇ˛ˇ˛ˇÅÅ·íˇ˛ˇˇ˛ˇˇˇÅŇ벡˛ˇ˛ˇˇ˛ÅÅflÅÅÅ„ÅÅÅ„ÅÅÅ„ù¸ˇˇˇ‘ˇˇ˙ˇˇÅáúˇˇˇ’ˇˇ¸ˇˇÅà"úˇˇ˛ÙˇÙ˛Ó˛˝ˇ˛ˇÅà;ùˇˇˇˇˇˇ¯ˇˇˇˇˇ¸ˇ
  6048. ˇˇˇˇˇˇ˚ˇ¸ˇ˛ˇÅàDùˇˇˇ˛
  6049. ˇˇˇˇˇ˛
  6050. ˇˇˇˇˇˇ˛    ˇˇˇˇˇ˝ˇˇ¸ˇ˝ˇÅà@ùˇˇˇ˛ˇ˛ˇ˛ˇ˛ˇˇ˛ˇˇ˛˛˛ˇ¯ˇ˝ˇ˛ˇÅá?ûˇˇˇ˛ˇˇ˝ˇˇ˛ˇ˛ˇˇˇ˛ˇ˛ˇˇ˜ˇ˝ˇ˛ˇÅáBûˇˇˇˇˇˇˇˇˇˇˇˇˇˇ˛ˇˇˇˇˇˇˇˇˇ˚ˇˇ¸ˇˇÅÜAüˇ˛ˇˇ˛ˇˇ˛
  6051. ˇˇˇ˛ˇˇ˛ˇ˛˝ˇˇ˛ˇˇ˛ˇ˛˛˛˙˛ˇ˝ˇˇˇÅÖÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„òÅûÄ¿ùHHQbê"IJˇˇˇˇˇˇˇˇˇˇÃÃˇˇˇˇôôˇˇˇˇffˇˇˇˇ33ˇˇˇˇˇˇÃÃˇˇˇˇÃÃÃÃˇˇÃÃôô    ˇˇÃÃff
  6052. ˇˇÃÃ33 ˇˇÃà ˇˇôôˇˇ
  6053. ˇˇôôÃÃˇˇôôôôˇˇôôffˇˇôô33ˇˇôôˇˇffˇˇˇˇffÃÃˇˇffôôˇˇffffˇˇff33ˇˇffˇˇ33ˇˇˇˇ33ÃÃˇˇ33ôôˇˇ33ffˇˇ3333ˇˇ33ˇˇˇˇˇˇÃàˇˇôô!ˇˇff"ˇˇ33#ˇˇ$ÃÃˇˇˇˇ%ÃÃˇˇÃÃ&ÃÃˇˇôô'ÃÃˇˇff(ÃÃˇˇ33)ÃÃˇˇ*ÃÃÃÃˇˇ+ÃÃÃÃÃÃ,ÃÃÃÃôô-ÃÃÃÃff.ÃÃÃÃ33/ÃÃÃÃ0ÃÃôôˇˇ1ÃÃôôÃÃ2ÃÃôôôô3ÃÃôôff4ÃÃôô335ÃÃôô6ÃÃffˇˇ7ÃÃffÃÃ8ÃÃffôô9ÃÃffff:ÃÃff33;ÃÃff<ÃÃ33ˇˇ=ÃÃ33ÃÃ>ÃÃ33ôô?ÃÃ33ff@ÃÃ3333AÃÃ33BÃÃˇˇCÃÃÃÃDÃÃôôEÃÃffFÃÃ33GÃÃHôôˇˇˇˇIôôˇˇÃÃJôôˇˇôôKôôˇˇffLôôˇˇ33MôôˇˇNôôÃÃˇˇOôôÃÃÃÃPôôÃÃôôQôôÃÃffRôôÃÃ33SôôÃÃTôôôôˇˇUôôôôÃÃVôôôôôôWôôôôffXôôôô33YôôôôZôôffˇˇ[ôôffÃÃ\ôôffôô]ôôffff^ôôff33_ôôff`ôô33ˇˇaôô33ÃÃbôô33ôôcôô33ffdôô3333eôô33fôôˇˇgôôÃÃhôôôôiôôffjôô33kôôlffˇˇˇˇmffˇˇÃÃnffˇˇôôoffˇˇffpffˇˇ33qffˇˇrffÃÃˇˇsffÃÃÃÃtffÃÃôôuffÃÃffvffÃÃ33wffÃÃxffôôˇˇyffôôÃÃzffôôôô{ffôôff|ffôô33}ffôô~ffffˇˇffffÃÃÄffffôôÅffffffÇffff33ÉffffÑff33ˇˇÖff33ÃÃÜff33ôôáff33ffàff3333âff33äffˇˇãffÃÃåffôôçfffféff33èffê33ˇˇˇˇë33ˇˇÃÃí33ˇˇôôì33ˇˇffî33ˇˇ33ï33ˇˇñ33ÃÃˇˇó33ÃÃÃÃò33ÃÃôôô33ÃÃffö33ÃÃ33õ33ÃÃú33ôôˇˇù33ôôÃÃû33ôôôôü33ôôff†33ôô33°33ôô¢33ffˇˇ£33ffÃç33ffôô•33ffff¶33ff33ß33ff®3333ˇˇ©3333ÃÙ3333ôô´3333ff¨333333≠3333Æ33ˇˇØ33ÃÃ∞33ôô±33ff≤3333≥33¥ˇˇˇˇµˇˇÃÃ∂ˇˇôô∑ˇˇff∏ˇˇ33πˇˇ∫ÃÃˇˇªÃÃÃúÃÃôôΩÃÃffæÃÃ33øÃÿôôˇˇ¡ôôÃìôôôô√ôôffƒôô33≈ôôΔffˇˇ«ffÃûffôô…ffff ff33ÀffÃ33ˇˇÕ33ÃÃŒ33ôôœ33ff–3333—33“ˇˇ”ÃÑôô’ff÷33◊ÿˇˇˇŸ˘`˘`˘`⁄Ú–Ú–Ú–€Ï@Ï@Ï@‹Â∞Â∞Â∞›fl fl fl fiÿêÿêÿêfl“““‡ÀpÀpÀp·ƒ‡ƒ‡ƒ‡‚æPæPæP„∑¿∑¿∑¿‰±0±0±0™†™†™†Ê§§§ÁùÄùÄùÄËñññÈê`ê`ê`Íâ–â–â–ÎÉ@É@É@Ï|∞|∞|∞Ìv v v ÓoêoêoêÔiiibpbpbpÒ[‡[‡[‡ÚUPUPUPÛN¿N¿N¿ÙH0H0H0ıA†A†A†ˆ;;;˜4Ä4Ä4į---˘'`'`'`˙ – – –˚@@@¸∞∞∞˝
  6054.  
  6055.  
  6056.  ˛êêêÄ¿ùRlíÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ÅÅÅ„ˇ‹@ˇ ˇˇˇˇ@
  6057. ˇ·ˇ‚7^
  6058. 4H\, Palatino
  6059. .+ä"CHAPTER œ´)\2,     Helvetica
  6060.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê))riting a Chooser-Compatible Device Driver
  6061. ~¿(‡2
  6062. ‡)-a¿)23
  6063. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6064. 1/91(¯ä Second line.4^H¿,
  6065.  
  6066. Zapf Dingbats
  6067. °dONLNd_äfè(eän
  6068. °dONLNd]ñh?) (The titles and positions of the buttons.
  6069. °dONLNd+qäxè(wän
  6070. °dONLNd-oñz©) The ª¿°dONLNd1o©z˝)radio button label.k¿°dONLNdDo˛z)U 
  6071. °dONLNdFÉääè(âän
  6072. °dONLNdHÅñå©) The ª¿°dONLNdLÅ©åÀ)AppleTû °dONLNdRÅÀå+)"alk device type name˙‡°dONLNdfÅ+å|)`. The Chooser searN‡°dONLNdxÅ}åµ)R
  6073. ches the curr£Ä°dONLNdÖŵå≈)8ent ¢Ä°dONLNdâÅ≈åÊ)AppleTU¿°dONLNdèÅÊå
  6074. )!    alk zone °dONLNdòçñò¸(ïñfor devices of this type.
  6075. °dONLNd≤°ä®è(ßän
  6076. °dONLNd¥üñ™¶) An :@°dONLNd∑ü¶™«)AppleTÌİdONLNdΩüΔ™#) alk Name-Binding PrÆ °dONLNd–ü$™_)^
  6077. otocol (NBP) ≈†°dONLNd›ü_™ö);retry intervalz°dONLNdÎüõ™∏)< and a Á °dONLNdÚü∏™¸)timeout count. |°dONLNdü˝™)EThe °dONLNd´ñ∂J(≥ñ'Chooser uses this information when searö‡°dONLNd,´J∂t)¥
  6078. ching for ɰdONLNd6´t∂ï)*AppleT6@°dONLNd<´ï∂»)! alk devices.°dONLNdI√äŒ(Àä!When a user selects the icon corrØ@°dONLNdj√Œ )ê6esponding to a particular device package, the Chooser °dONLNd†œä⁄È(◊äPsends messages to that device package by calling the device package as if it werѰdONLNdœÈ⁄(◊Èe the °dONLNdˆ€äÊfi(„äfollowing function:,
  6079. Courier.°dONLNd
  6080. Úä˛Í*FUNCTION Package°dONLNd"ÚͲå)` (message, caller: Integer;°dONLNdGˆ §+ objName, zoneName: StringPtr;°dONLNdnˆå*p1, p2: LongInt) : OSErr;
  6081. )H64*H5
  6082. .°dONLNdˇˇ(1äNOTE
  6083. ˇ·ˇ‚7^
  6084. °dONLNdà4ä?·* Like the driver subr$@°dONLNdú4‚?≥)X.outine names, the name Package for the device °dONLNd @äK¥(Hä    package r@°dONLNd”@µK5)+outine is a descriptive name. “¿°dONLNdÒ@5K;)ÄYì@°dONLNdÚ@;K∏)ou can choose any name for °dONLNd
  6085. LäW(Täyour actual device package r̆°dONLNd)LWö)~ outine—the Chooser locates the rìİdONLNdILõWπ)ìoutine °dONLNdPXäc9(`ä&using the device package header you pr8`°dONLNdvX:cW)∞ovide. 
  6086. !‡°dONLNdˇˇ)!u
  6087.     °dONLNdípä{Ó(xäParameter descriptions
  6088. .°dONLNd©~ää¥*message.°dONLNd±ÃäÏ)BIdentifiÿ°dONLNdπÏäˇ) >es the operation to be performed and has one of the following °dONLNd˜ãÃñ(ìÃconstant values:.°dONLNd ööˆ*initMsg°dONLNdöˆ¶)* = 11;°dONLNd"ö¶>)$      °dONLNd*ö>¶)$#{user selected this device package}°dONLNdS¶Ã≤(ØÃ    newSelMsg°dONLNd`¶≤)6 = °dONLNdd¶≤&)12;°dONLNdh¶&≤>)    °dONLNdm¶>≤)!{user made new device selections}°dONLNdî≤Ãæ(ªÃ fillListMsg°dONLNd£≤æ )B = °dONLNdß≤ æ2)13;°dONLNd´≤2æ>)  °dONLNdÆ≤>æ) #{fill the device list with choices}°dONLNd◊æÃ («Ã    getSelMsg°dONLNd‰æ )6 =°dONLNdÁæ &) 14; °dONLNdÎæ& ,) °dONLNdÏæ, >)   °dONLNdÒæ> )#{mark one or more choices selected}°dONLNd Ã÷(”à   selectMsg°dONLNd' ÷)6 = °dONLNd+ ÷,)15; °dONLNd0 ,÷2) °dONLNd1 2÷>)  °dONLNd4 >÷») {user made a selection}°dONLNdQ÷Â(flà deselectMsg°dONLNd`÷‚ )B = °dONLNdd÷ ‚8)16; °dONLNdh÷8‚>) °dONLNdj÷>‚Ê){user cancelled a selection}°dONLNdå‚ÃÓ(ÎÃ
  6089. terminateMsg °dONLNdù‚Ó&)N= °dONLNd†‚&Ó8) 17;°dONLNd•‚8Ó)$ {allows device package to clean up}°dONLNdœÓÃ˙(˜Ã    buttonMsg°dONLNd‹Ó˙)6 = °dONLNd‡Ó˙,)18; °dONLNd‰Ó,˙2) °dONLNdÁÓ2˙Œ)  {user selected a button}.°dONLNdˇÃ
  6090. (Ã The section $@°dONLNdˇ
  6091. ≥)5&“Responding to the Chooser” on page 2-fi°dONLNd5ˇ≥
  6092. Ω)≤27fi°dONLNd7ˇΩ
  6093. )
  6094.  explains these °dONLNdG Ã(Ãmessages in morı†°dONLNdV 7)I    e detail..°dONLNd`ä&Æ(#äcaller.°dONLNdgÃ&Ï)BIdentifiÿ°dONLNdoÏ&) 
  6095. es the caller†°dONLNd|&$)3. í@°dONLNd~$&+)AǰdONLNd+&∫)! value of 1 indicates the ChooserY`°dONLNd†∫&Δ)è. V¶Ä°dONLNd£≈&˙)
  6096. alues in the °dONLNd∞'Ã2(/Ãrange 0 to 127 ar†°dONLNd¡'2 )Ie r(@°dONLNdƒ' 2ˇ) 2eserved; values outside this range may be used by °dONLNdˆ3Ã>(;Ã
  6097. applications..°dONLNdBäN∫(KäzoneName.°dONLNd
  6098. CÃN)BContains name of q°dONLNdCN=)PAppleT$@°dONLNd$C=N)!.alk zone containing the devices in the device °dONLNdROÃZ˚(WÃIlist. If the Chooser is being used with the local zone and bit 24 of the ˇ¸‚6.°dONLNdõZÃfÍ* flagsˇ˛q°dONLNd†[ÍfÔ) f¡õ°dONLNd¢[Ôf)Bield of the device package header is not set, the string value is fl°dONLNd‰[f(c'*'; .°dONLNdÈgÃr±(oÃ6otherwise, it’s the actual zone name. See the section R`°dONLNdg≤r¬)Ê“Cr.`°dONLNd"g¬r)eating a Device °dONLNd2sÃ~%({ÃPackage” on page 2-W`°dONLNdEs&~0)Z26W`°dONLNdGs0~S)
  6099.  for mor!‡°dONLNdOsT~)$&e information about the package headerZ¿°dONLNdus~)Ø..°dONLNdwÇäéñ(ãäp1.°dONLNdzÉÃé)BLContains a handle to the List Manager list that contains the device choices °dONLNdΔèÃöY* "displayed in the device list box. ˇ#Ä@ˇ ˇˇˇˇ@
  6100. ˇ·ˇ‚7^
  6101. 4*\˜, Palatino
  6102. .+l"CHAPTER œ´)\2,     Helvetica
  6103.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6104. (‡*2 )-c)24
  6105.     )9W’ê))riting a Chooser-Compatible Device Driver
  6106. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6107. 1/91(¯l Second line.4^*¿¯,
  6108. Courier
  6109. .°dONLNd\lhñ(elobjName.°dONLNd]ÆhÏ)BEContains other information. The meaning of this parameter depends on ˇ˛∫q.°dONLNdMiÆt˜* the value of the ˇ˝t‚iƒ°dONLNd^h¯t")Jmessageˇ˛∫qiƒ°dONLNdei"tS)*
  6110.  parameterf’°dONLNdoiSti)1. See €∑°dONLNduiit˜)“Responding to the Chooser” on .°dONLNdîuÆÄŒ(}Æpage 2-Æ¿°dONLNdõuŒÄÿ) 27Æ¿°dONLNdùuÿÄ˚)
  6111.  for mory@°dONLNd•u¸Ä8)$
  6112. e information.°dONLNd≥Ñlêx(çlp2°dONLNdµÖxê{)  .°dONLNd∑ÖÆêÏ)6EContains other information. The meaning of this parameter depends on ˇ˛∫q.°dONLNd¸ëÆú˜* the value of the ˇ˝t‚iƒ°dONLNd
  6113. ê¯ú")Jmessageˇ˛∫qiƒ°dONLNdë"úS)*
  6114.  parameterf’°dONLNdëSúi)1. See €∑°dONLNd$ëiú˜)“Responding to the Chooser” on .°dONLNdCùÆ®Œ(•Æpage 2-Æ¿°dONLNdJùŒ®ÿ) 27Æ¿°dONLNdLùÿ®˚)
  6115.  for mory@°dONLNdTù¸®8)$
  6116. e information°dONLNdbµl¿(ΩlWhen the user opens the ChooserÜ`°dONLNdŵ¿N)î, the Chooser sear¸°dONLNdìµN¿fl)N"ches the Extensions folder in the °dONLNdµ¡lÃj(…l9System Folder of the startup disk for Chooser extension fi∂¿°dONLNdÔ¡jÃ)˛les. For each one it fi@°dONLNd¡ƒÃ·)Znds, it ˇ˛ãë.°dONLNdÕlÿü(’l opens the fió"°dONLNdÕüÿQ)3+le, fetches the device’s icon, fetches the ˇ˝"h°dONLNdEÃRÿp)≥flagsˇ˛ãëh°dONLNdJÕpÿx) fiÛ™°dONLNdMÕxÿê)eld frQõ°dONLNdSÕëÿ¯)om the device package .°dONLNdiŸl‰ä(·lheader5†°dONLNdoŸä‰’), and closes the fiû†°dONLNdÇŸ’‰„)K>le. The Chooser then displays each device’s icon, graying the °dONLNd¿Âlî(Ìl
  6117. icons for ∫ °dONLNd Âîµ)(AppleTm`°dONLNd–µÒ)!alk devices if -†°dONLNdflÂÒ)<AppleT‡‡°dONLNdÂÂk) alk is not connected.°dONLNd˚˜læ(ˇlMWhen the user selects a device package icon that is not grayed, the Chooser r°dONLNdH˜ø(ˇø eopens the °dONLNdSl}( lcorr`°dONLNdW~    )esponding Chooser extension fif‡°dONLNdu    {)ãle and does the following:°dONLNdën u(n1.°dONLNdîx †)
  6118. FThe Chooser labels the device list box with the device list box label.°dONLNd‹'n2u(/n2..°dONLNdfl'x2„)
  6119. The Chooser sends the °dONLNdı&„2˚)kinit°dONLNd˘'˚2∫)) message to the selected device package. .°dONLNd$9nDu(An3.°dONLNd'9xD)
  6120.  If the selected device package r≠İdONLNdG9D)âepr>@°dONLNdJ9Dn)esents a serial printerô°dONLNda9mD„)], the Chooser places in the °dONLNd}ExP(Mx$device list box the two icons that r†°dONLNd°EP)óeprò`°dONLNd§EPÙ)1esent the printer port and the modem port serial °dONLNd’Qx\m(Yx7drivers. When the user makes a selection, the Chooser rS†°dONLNd Qm\)ıecor»°dONLNdQ\Ø) ds the userª‡°dONLNdQ∞\ˆ)1’s choice in low °dONLNd,]xh˝(exmemory and parameter RAM.°dONLNdGonzu(wn4.°dONLNdJoxz)
  6121.  If the selected device package r≠İdONLNdjoz)âepr>@°dONLNdmoz:)
  6122. esents an “@°dONLNdwo:z[)*AppleTÖİdONLNd}o[z‰)!alk device and does not accept ˇ˛\.°dONLNdúzxÜ®(ÉxfillListˇˇ
  6123. ưdONLNd§{®Ül)0+ messages, the Chooser initiates an asynchr§t°dONLNdœ{lÜä)ƒonous rÑǰdONLNd÷{äÜŸ)outine that interrr>°dONLNdË{ŸÜ¯)Oogates .°dONLNdÔáxíö(èxthe curr `°dONLNd˜áõí´)#ent  `°dONLNd˚á´íÃ)AppleT憰dONLNdáÀíû) 0alk zone for all devices whose type matches the ]†°dONLNd1áüí¿)‘AppleT‡°dONLNd7á¿íÔ)! alk device °dONLNdBìxû≈(õxtype name specifi˙`°dONLNdSì≈ûH)Med in the Chooser extension fi  °dONLNdqìIûã)Ñle. The asynchrû°dONLNdÄìãû¨)Bonous r„İdONLNdáì¨û)!outine uses the °dONLNdóüx™{(ßxrE°dONLNdòü|™)%etry interval and the timeout count. 燰dONLNdΩü™-)üAs r◊ °dONLNd¡ü-™‰))esponses arrive, the Chooser updates the °dONLNdÍ´x∂π(≥xdevice list box.°dONLNd¸Ωn»u(≈n5.ˇˇÿù.°dONLNdˇΩx»@)
  6124. , If the selected device package does accept ˇˇ±:D˰dONLNd+ºA»q)…fillListˇˇÿùD˰dONLNd3Ωq»¯)0 messages, the Chooser sends ˇ˛¥º°dONLNdP…x‘â(—xthe ˇ˝ix4º°dONLNdT»ä‘∫)fillListˇ˛¥º4º°dONLNd\…∫‘®)04 message to the device package. The device package ra∏°dONLNdê…®‘‡)Ó esponds by fiÀ0°dONLNdù…‡‘˜)8lling .°dONLNd£’x‡Û(›xthe device list with the appr’ °dONLNd¿’Û‡V){opriate device choices.°dONLNdŸÁnÚu(Ôn6.°dONLNd‹ÁxÚ~)
  6125. Tµ¿°dONLNd›Á}ÚÒ)Wo determine which entries in the device list should be selected, the Chooser calls the .°dONLNd4Ûx˛Ô(˚xdevice package with the °dONLNdLÚÔ˛)wgetSel°dONLNdRÛ˛§)$ message. The device package rR`°dONLNdpÛ§˛ÿ)ë esponds by .°dONLNd{ˇx
  6126. ¿(xNinspecting the list and setting the selected or unselected state of each entryèİdONLNd…ˇø
  6127. ◊(ø. The .°dONLNdœ x·(xChooser may send the °dONLNd‰
  6128. ·)igetSel°dONLNdÍ 8)$  message frR`°dONLNdı 8Ò)3'equently; for example, each time a new .°dONLNd    x"{(xrE°dONLNd    |"Ω)esponse to the R °dONLNd    ,Ω"fi)AAppleT`°dONLNd    2fi")!alk zone interr
  6129. ¿°dONLNd    A"Ô)@/ogation arrives. The Chooser does not send the .°dONLNd    p"x.ú(+xgetSel°dONLNd    v#ú.ô)$9 message for serial printers; it highlights the icon corrR`°dONLNd    Ø#ô.Ë)˝esponding to the .°dONLNd    ¿/x:ä(7xcurrذdONLNd    ƒ/ä: ) ently-selected serial port, as r°°dONLNd    ‰/ :)Åecor`°dONLNd    Ë/:u)ded in low memoryR@°dONLNd    ˘/t:v)V.°dONLNd    ¸AnLu(In7.°dONLNd    ˇAxLˆ)
  6130. YIf the device package allows multiple devices to be active at once, the Chooser sets the °dONLNd
  6131. XMxXå* apprI@°dONLNd
  6132. \MçX“)Lopriate List Manager bits. When the user selects or deselects a device, the °dONLNd
  6133. ®YxdG(ax.Chooser calls the device package with the appr)‡°dONLNd
  6134. ÷YHdÚ)–&opriate message. For packages that do .°dONLNd
  6135. ¸expÖ(mx:not accept multiple active devices, the Chooser sends the °dONLNd 6dÖp©(mÖselect°dONLNd <e©p∏)$ or °dONLNd @d∏pË)deselect°dONLNd HeËpÎ)0 °dONLNd Iqx|(yx!message; otherwise, it sends the °dONLNd jp|4)ònewSel°dONLNd pq4|Ô)$' message. The device package mounts or .°dONLNd ó}xà˜(Öxunmounts the device, if appr
  6136. †°dONLNd ≥}¯à3)Äopriate, and rõ`°dONLNd ¡}3àE);ecor¿°dONLNd ≈}Fàó)ds the user choice.°dONLNd ⁄ènöu(ón8.°dONLNd ›èxöÛ)
  6137. When the user chooses a dif‰¿°dONLNd ¯èÛöˇ){fer«@°dONLNd ˚èˇö¢) %ent device type or closes the ChooserV@°dONLNd  è¢öÙ)£, the Chooser calls ˇ˛¥º.°dONLNd 4õx¶ö(£xthe curr°dONLNd <õõ¶)#ent device package with the ˇ˝ixé»°dONLNd Xö¶R)Å    terminateˇ˛¥ºé»°dONLNd aõR¶˜)6& message, if the package accepts this .°dONLNd áßx≤ƒ(Øxkind of message. ¿°dONLNd ò߃≤§)L4At this time, the package can clean up, if necessary≤`°dONLNd Ãߣ≤‚)fl. The Chooser ˇÊ@ˇ ˇˇˇˇ@
  6138. ˇ·ˇ‚7^
  6139. 4H\, Palatino
  6140. .+ä"CHAPTER œ´)\2,     Helvetica
  6141.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê))riting a Chooser-Compatible Device Driver
  6142. ~¿(‡2
  6143. ‡)-a¿)25
  6144. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6145. 1/91(¯ä Second line.4^H¿
  6146. ˇˇ4.°dONLNd]ñh◊(eñthen calls the ,
  6147. Courierˇ˛h≠ú°dONLNd\◊h%)A
  6148. UpdateResFileˇˇ4≠ú°dONLNd]%h1)N prè0°dONLNd]1hN) oceduraê°dONLNd%]Nh™)e, closes the device rp¿°dONLNd;]™h¡)\esourC °dONLNd@]¡h”)ce fiRT°dONLNdE]”h˚)    le, and flpº°dONLNdO]˚h)(ushes .°dONLNdUiñt(qñthe system startup volume.
  6149. ôHü4öHü öäö
  6150. ˇ·ˇ‚7^
  6151. ˇˇ◊ˇ◊°dONLNdpâäôö(ïäCrîø°dONLNdrâõôt)eating a Chooser Extension Fileˇˇˇˇˇˇ•(ï2
  6152. °dONLNdí†ä´Ù(®äThe Chooser accepts thrå¿°dONLNd©†Ù´)jee types of Chooser extension fiX‡°dONLNd…†Ä´À)åles to identify difW°dONLNd‹†À´◊)Kfer9İdONLNdfl†◊´
  6153. )
  6154. ent kinds of °dONLNdϨä∑≠(¥ädevices:
  6155.     °dONLNdˆæä…Æ*    File type°dONLNdæÓ… )d Device type
  6156. .°dONLNdÃäÿÆ(’ä'PRES'.°dONLNdÕÓÿ')dSerial printer.°dONLNd&◊䄯(‡ä'PRER'.°dONLNd-ÿÓ„=)dNon-serial printer.°dONLNdA‚äÓÆ(Îä'RDEV'.°dONLNdH„ÓÓ&)d Other device°dONLNdUÓH˘J(ˆH °dONLNdZä ê+BY@İdONLNd[ê Í)ou can specify the crU¿°dONLNdpÍ H)Zeator of your device rİdONLNdÜI a)_esourL¿°dONLNdãa r)ce fi`°dONLNdês )"le, which allows you to give your °dONLNd≤ ä·(ädevice its own icon.°dONLNd«ä)ê*Y@İdONLNd»ê))ou can include these r¶†°dONLNdfi))`esourÓ‡°dONLNd„)Ü)ces in your device package fi≤¿°dONLNdá)ë)le:
  6157.     °dONLNd1ä;∑(8ä
  6158. Resource T@–°dONLNd1∑;‰)-
  6159. ype and ID°dONLNd1;8)Q Description
  6160. .°dONLNd)>äJÆ(Gä'PACK'.°dONLNd0?¥JÕ)*–4096°dONLNd6?Jk)TDevice package. This r °dONLNdL?lJÑ)desourN`°dONLNdQ?ÑJ‰)ce contains the device°dONLNdkKVz(Spackage header and code..°dONLNdÖ\ähÆ(eä'STR '.°dONLNdå]¥hÕ)*–4096°dONLNdí]h)TT∫¿°dONLNdì]
  6161. hJ)
  6162. ype name for b@°dONLNd†]Jhk)=AppleTİdONLNd¶]khÌ)!alk devices. The Chooser searK‡°dONLNd√]Ìh)Çches °dONLNdÃit*(qthe curr `°dONLNd‘i+t;)#ent  `°dONLNdÿi;tË)(Appletalk zone for devices of this type..°dONLNdzäÜÆ(Éä'GNRL'.°dONLNd    {¥ÜÕ)*–4096°dONLNd{Üâ)TAppletalk information. The fi;@°dONLNd,{äÜœ)Çrst byte of this róİdONLNd>{œÜÁ)Eesourfl¿°dONLNdC{ÁÜ)ce°dONLNdIáíç(ècontains the Name-Binding Pr¿°dONLNdeáéíÕ)Üotocol (NBP) rÛ@°dONLNdsáÃí)>etry interval,°dONLNdÇìHûJ(õH °dONLNdÜìû«)¿+the second byte contains the timeout count..°dONLNd≥§ä∞Æ(≠ä'STR '.°dONLNd∫•¥∞Õ)*–4091°dONLNd¿•∞)T<List box label. The Chooser labels the device list with this°dONLNd±º„* 5string after the user has selected the device’s icon..°dONLNd7¬äŒÆ(Àä'STR '.°dONLNd>√¥ŒÕ)*–4087°dONLNdD√Œ\)TRadio button label..°dONLNdY‘䇯(›ä'STR '.°dONLNd`’¥‡Õ)*–4088°dONLNdf’‡)TOfÇ °dONLNdh’‡f) f radio button title..°dONLNdÊäÚÆ(Ôä'STR '.°dONLNdÜÁ¥ÚÕ)*–4089°dONLNdåÁÚe)TOn radio button title..°dONLNd§¯äÆ(ä'STR '.°dONLNd´˘¥Õ)*–4092°dONLNd±˘V)TRight button title..°dONLNdΔ
  6163. äÆ(ä'STR '.°dONLNdÕ ¥Õ)*–4093°dONLNd” O)TLeft button title..°dONLNdÁä(Æ(%ä'ncrt'.°dONLNdÓ¥(Õ)*–4096°dONLNdÙ(S)TButton positions..°dONLNd.ä:Æ(7ä'LDEF'.°dONLNd/¥:Õ)*–4096°dONLNd/:T)TAlternate list defiM‡°dONLNd'/U:{)M    nition pr¿`°dONLNd0/{:ô)&ocedurW†°dONLNd6/ö:£)e. Û†°dONLNd9/£:©)    Y¥ °dONLNd:/©:˙)ou can supply this°dONLNdP;F(CprG °dONLNdR;F0)
  6164. ocedurfi`°dONLNdX;0Fı)-e to modify the device list—to include pictur ‡°dONLNdÖ;ˆFˇ)Δes°dONLNdàGHRJ(OH °dONLNdåGRf)¿or icons, for example..°dONLNd§XädÆ(aä'STR '.°dONLNd´Y¥dÕ)*–4090°dONLNd±Ydó)TReserved for use by the Chooser…†°dONLNd–Yñdò)é.ˇˇ—z.°dONLNd“qä|ë(yäYï°dONLNd”qê|)ou should also include a ˇˇ¢Ù¨b°dONLNdÏp|%)q'BNDL'ˇˇ—z¨b°dONLNdÚq%|+)$ rP<°dONLNdÙq,|C)esour"ú°dONLNd˘qC|)0ce to give your device type a distinctive icon, .°dONLNd)}äà`(Öä0because this may be the only way that devices arD†°dONLNdY}aàà)◊    e identifid‡°dONLNdc}àà˝)'ed in the Chooser windowº°dONLNd{}¸à)t. The .°dONLNdÅâäî=(ëä'Finder Interface chapter describes the °dONLNd®à=îa)≥'BNDL'°dONLNdÆâaîh)$ rR`°dONLNd∞âhî)esour$¿°dONLNdµâîã)ce..°dONLNdπõä¶÷(£äThe next section, *@°dONLNdÀõ◊¶Á)M“Cr@°dONLNdŒõÁ¶Y)eating a Device Package,” @°dONLNdÁõY¶·)r discusses the device package ro‡°dONLNdõ·¶˘)àesour∏ °dONLNd õ˘¶)ce in °dONLNdßä≤ú(ØämoréİdONLNdßú≤)e detail, and the section †°dONLNd.ß≤f)k“How the Chooser W`İdONLNd@ße≤≠)^orks” on page 2-
  6165. `°dONLNdP߯≤∏)I21
  6166. `°dONLNdRß∏≤ )
  6167.  describes how the °dONLNde≥äæ›(ªäChooser uses the fiİdONLNdx≥fiæˆ)Telds rQ@°dONLNd~≥ˆæ)
  6168. elated to ÑİdONLNdà≥æ?)(AppleT7¿°dONLNdé≥?æN)!alk.ˇÑ@ˇ ˇˇˇˇ@
  6169. ˇ·ˇ‚7^
  6170. 4*\˜, Palatino
  6171. .+l"CHAPTER œ´)\2,     Helvetica
  6172.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6173. (‡*2 )-c)26
  6174.     )9W’ê))riting a Chooser-Compatible Device Driver
  6175. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6176. 1/91(¯l Second line.4^*¿¯
  6177. °dONLNd]lhÙ(elVThe Chooser window allows your device package to display two buttons, called the Left °dONLNdViltfi* Vbutton and the Right button because of their default positions. The left button has a °dONLNd¨ulÄú*
  6178. double borî °dONLNd∂uúÄfi)0Kder and is highlighted (the title string is dark, not gray) when one or morxİdONLNdufiÄÂ(}fie °dONLNdÅlåò(âl
  6179. devices ar؇°dONLNd
  6180. ÅòåÃ),
  6181. e selected fr„°dONLNdÅÃå∫)47om the device list. When this button is highlighted, prÁİdONLNdQÅ∫åÿ)Óessing °dONLNdXçlò∞(ïlReturn or Enterõ†°dONLNdgç∞ò[)D*, or double-clicking in the device list ar
  6182. °dONLNdëç\ò˜)¨%e equivalent to clicking the button. °dONLNd∂ôl§˚(°l!The right button has a single bor`°dONLNd◊ô¸§Ù)ê9der and is always highlighted, and the user can activate °dONLNd•l∞Δ(≠lit only by clicking it.°dONLNd(∑l¬‹*SThe Chooser also allows you to display two radio buttons and a radio button label. °dONLNd{√lŒµ* These buttons arû¿°dONLNdã√µŒb)I'e called the On radio button and the Of¨†°dONLNd≤√bŒÈ)≠f radio button because those ark@°dONLNd—√ÍŒÒ)àe °dONLNd”œl⁄Δ(◊lthe titles the LaserWnİdONLNdËœΔ⁄…)Z;riter uses, but you can give them whatever titles you want..°dONLNd$·lÏs(ÈlYï°dONLNd%·rÏ@).ou can position these buttons by including a rg`°dONLNdS·@ÏW)Œesour9¿°dONLNdX·WÏá) ce of type ,
  6183. Courier9¿°dONLNdc‡áÏ´)0'ncrt'9¿°dONLNdi·´ÏÒ)$ with an ID of 9¿°dONLNdx·Òψ)F–.°dONLNdyÌl¯û(ıl 4096. The fi»Ä°dONLNdÖÌû¯Ω)2rst worL°dONLNdåÌæ¯    ) d in this type of r@°dONLNdüÌ
  6184. ¯")LesourNİdONLNd§Ì"¯J)    ce specifivİdONLNdÆÌJ¯ö)(es the number of rŸ@°dONLNd¿Ìö¯Î)Pectangles, and the °dONLNd”˘lo(lrE°dONLNd‘˘pû) est of the ry¿°dONLNd‡˘û∂).esour¬°dONLNd¢∂˝)ce contains the rİdONLNdˆ˘˛6)H ectangle defi`°dONLNd˘6r)8nitions. The fi¿@°dONLNd˘rÉ)<rst rw@°dONLNd˘Ñ˜)ectangle positions the left °dONLNd3lU(
  6185. l7button, the second positions the right button, the thir1°dONLNdjVÊ)Í!d positions the On radio button, °dONLNdãlÙ(land the fourth positions the OfÃİdONLNd™ÙO)àf radio button. The fi/İdONLNd¿Pb)\fth r‹ °dONLNd≈bfi)ectangle positions the radio °dONLNd‚l(£(%l
  6186. button label.°dONLNd/l:á*Each r"`°dONLNdˆ/à:¿) ectangle defi#@°dONLNd/¿:m)8)nition is 8 bytes long and contains the r‡°dONLNd,/m:ß)≠
  6187. ectangle coor@‡°dONLNd9/ß:Â):dinates in the °dONLNdH;lFu(Clor∫İdONLNdJ;uFP)    5der [top, left, bottom, right]. The default values ar°dONLNd;QF`)‹e [1‡°dONLNdÉ;`F‹) 12, 206, 132, 266] for the left °dONLNd£GlRß(Ol
  6188. button and [1é¿°dONLNd∞GßRL);)12, 296, 132, 356] for the right button. &†°dONLNdŸGMRS)¶YÁ °dONLNd⁄GRRƒ)ou could use the values [1#İdONLNdÙG≈RË)s    12, 251, °dONLNd˝Sl^([l$132, 331] to center a single button.°dONLNd"elp*'The Chooser uses the List Manager to prE°dONLNdIep§)≥oduce and display the standarŒ°dONLNdfe§pfi)Öd device list. ∫ °dONLNduefip‰):Yz†°dONLNdve‰pÒ)ou °dONLNdyql|«(ylcan supply a list defi√¿°dONLNdèq«|Ì)[    nition pr6@°dONLNdòqÓ| )'ocedurÕİdONLNdûq |ˆ)6e to modify this list. For example, you might want to °dONLNd‘}là™(Ölinclude picturh °dONLNd‚}™à)>es or icons in your list. Tq`°dONLNd˝}àv)ko do this, you must prfi†°dONLNd}vàú)a    ovide a rç °dONLNd}ùàµ)'esour’`°dONLNd!}µà‚) ce of type .°dONLNd,àlîê(ël'LDEF'°dONLNd2âêî°)$: with an ID of –4096. See the List Manager chapter in the .°dONLNdlâ°îÎ(ë°Inside Macintosh: °dONLNd~ïl†ü(ùl Macintosh TİdONLNdâïû†∑)2oolbox©Ä°dONLNdèï∏†e)( volume for the mechanics of list constr‡†°dONLNd∑ïe†‹)≠uction and for the list data °dONLNd‘°l¨w(©lstrfi°dONLNd◊°w¨é) ucturc‡°dONLNd‹°è¨ñ)e.
  6189. —*◊¯4“*◊¯ “l“¯
  6190. ˇ·ˇ‚7^
  6191. ˇˇ◊ˇ◊°dONLNdfl¡l—|(ÕlCrîø°dONLNd·¡}—#)eating a Device Packageˇˇˇˇˇˇ•(Õ2
  6192. °dONLNd˘ÿl„´(‡lLike a driver r{ °dONLNdÿ´„√)?esour√`°dONLNd
  6193. ÿ√„\)#ce, a device package has two parts:,
  6194.  
  6195. Zapf Dingbats
  6196. °dONLNd1ÏlÛq(Úln
  6197. °dONLNd3Íxı+) 'the package header that contains some flÕ‡°dONLNd[Í+ı‡)≥(ags and some other data about the driver
  6198. °dONLNdÑ˛lq(ln
  6199. °dONLNdá¸xfi) the package code that rù‡°dONLNdû¸fia)fesponds to Chooser messages°dONLNd∫l(l%The package header contains a few worˇ@°dONLNdfl8)Æds of fl. °dONLNdÁ9…) ags and other data and a branch °dONLNd    l%Ä("linstró¿°dONLNd     Ä% ) uction to the package’s Device r‡°dONLNd    ,
  6200. %.)çoutine. K@°dONLNd    4.%F)!Figur°dONLNd    9F%Z)e 2-3ªÄ°dONLNd    >Z%Â) shows the format of a package °dONLNd    ]&l1ä(.lheader5†°dONLNd    c&ä1å).ˇ,ä@ˇ ˇˇˇˇ@
  6201. ˇ·ˇ‚7^
  6202. 4H\, Palatino
  6203. .+ä"CHAPTER œ´)\2,     Helvetica
  6204.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê))riting a Chooser-Compatible Device Driver
  6205. ~¿(‡2
  6206. ‡)-a¿)27
  6207. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6208. 1/91(¯ä Second line.4^H¿
  6209. gHw4gHw"gH_
  6210. ˇ·ˇ‚7^
  6211.     °dONLNdˇˇ(dä
  6212. Figure 2-3°dONLNd\ÃgL)BThe format of a package header
  6213. °dONLNd°ä¨9(©ä'Since the Chooser expects the Package r °dONLNdF°:¨ı)∞,outine to be at the beginning of the device .°dONLNdr≠ä∏–(µäpackage, the fi°dONLNdÅ≠–∏Ê)Frst fi°dONLNdá≠Ê∏ú)&eld of the package header should be a ,
  6214. Courier°dONLNd≠¨ú∏∫)∂BRA.S°dONLNd≤≠∫∏“) instrl°dONLNd∏≠“∏)uction to the .°dONLNdΔπ䃻(¡ä
  6215. package code.°dONLNd‘Àä÷6*(The device ID is an integer that identifi∫°dONLNd˝À6÷ª)¨es the device. The version worg‡°dONLNdÀº÷–)Üd dif.°dONLNd À—÷›)ferİdONLNd#À›÷)     entiates °dONLNd,◊ä‚(fläversions of the driver code.°dONLNdIÈäÙ≈*DThe package code should implement the Package function. The section É¿°dONLNdçÈ≈ÙÚ(Ò≈    “How the °dONLNdñıäª(˝ä    Chooser W·†°dONLNdüı∫)0orks” on page 2-ãİdONLNdØı
  6216. )I21ãİdONLNd±ı
  6217. ˙)
  6218. : gives the interface for this function. The next section, °dONLNdÎä (    ä“Responding to the Chooser¿°dONLNd )},”Ü¿°dONLNd  )* discusses how to implement this function.°dONLNd2ä£(äThe fl»Ä°dONLNd8£∫)ags fi!`°dONLNd>ª·)Beld contains information about the device and the device package. ø@°dONLNdÄ·Á(·Tı°dONLNdÅÊ)able 2-2İdONLNdâ     )# °dONLNdää*)('ä&lists the meaning of each bit of the fl‹‡°dONLNd±)*G)üag wor}İdONLNd∑H*P)d.
  6219. wäà4wäà
  6220. wäà®4vâwäò(W5W5wä–®ŸŸ=Ä˙`˙¿Ôf˘``˙`Ôaˇ˙{w‡˙~˛ÁÚ=øÄ˚cˇ`˙fi˚ø¯ÚÏ˙c«`˙€∑¿Ú}ˇÄ˚c‡˙fiÔxÚÎÎŸŸŸ
  6221. ¿ÒˇÌ
  6222.  Òˇ¯Ì
  6223.  Òˇ¯Ì
  6224.  Òˇ¯Ì
  6225.  Òˇ¯Ì
  6226. ¿Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì ˛Òˇ¯ ˛Òˇ¯ ˛Òˇ¯\‹ ˛Òˇ¯“§ ˛Òˇ¯R§ ˛Òˇ¯,ú˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6227. ¿Òˇ¯Ì
  6228.  Òˇ¯Ì
  6229.  Òˇ¯Ì
  6230. ¿Òˇ¯Ì
  6231. Òˇ¯Ì
  6232. ‡Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì ˛Òˇ¯ ˛Òˇ¯ ˛Òˇ¯\‹ ˛Òˇ¯“§ ˛Òˇ¯R§ ˛Òˇ¯,ú˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6233. @Òˇ¯Ì
  6234. ¿Òˇ¯Ì
  6235. @Òˇ¯Ì
  6236. ‡Òˇ¯Ì
  6237. @Òˇ¯Ì
  6238. @Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6239. ˛Òˇ¯˛Ú
  6240. ˛Òˇ¯˛Ú
  6241. ˛Òˇ¯Œq+gÚ
  6242. ˛Òˇ¯)ël…Ú
  6243. ˛Òˇ¯)ꨅÚ
  6244. ˛Òˇ¯…pìGÚ ˛Òˇ¯ ˛Òˇ¯‡˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6245. ¿Òˇ¯Ì
  6246.  Òˇ¯Ì
  6247.  Òˇ¯Ì
  6248. ¿Òˇ¯Ì
  6249.  Òˇ¯Ì
  6250. ¿Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì ˛Òˇ¯ ˛Òˇ¯ ˛Òˇ¯\‹ ˛Òˇ¯“§ ˛Òˇ¯R§ ˛Òˇ¯,ú˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6251. 0Òˇ¯Ì
  6252. HÒˇ¯Ì
  6253. HÒˇ¯Ì
  6254. HÒˇ¯Ì
  6255. HÒˇ¯Ì
  6256. 0Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6257. ˛Òˇ¯˛Ú
  6258. ˛Òˇ¯˛Ú
  6259. ˛Òˇ¯Œq+gÚ
  6260. ˛Òˇ¯)ël…Ú
  6261. ˛Òˇ¯)ꨅÚ
  6262. ˛Òˇ¯…pìGÚ ˛Òˇ¯ ˛Òˇ¯‡˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6263. Òˇ¯Ì
  6264. 0Òˇ¯Ì
  6265. PÒˇ¯Ì
  6266. xÒˇ¯Ì
  6267. Òˇ¯Ì
  6268. Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì ˛Òˇ¯ ˛Òˇ¯ ˛Òˇ¯\‹ ˛Òˇ¯“§ ˛Òˇ¯R§ ˛Òˇ¯,ú˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì
  6269. 0Òˇ¯Ì
  6270. HÒˇ¯Ì
  6271. HÒˇ¯Ì
  6272. 0Òˇ¯Ì
  6273. HÒˇ¯Ì
  6274. 0Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯Ì˛Òˇ¯ÌˇÌˇÌˇÌˇÌˇÌˇÌˇÌˇÌˇÌˇÌ ¯ÛˇÌ
  6275. ˛ÄÚÌ
  6276. ˛ÄÚÌ
  6277. ˛ÄÚÌ
  6278. ˛ÄÚÌ
  6279. ˛ÄÚÌ
  6280. ˛ÄÚÌ
  6281. ˛ÄÚÌ
  6282. ˛ÄÚÌ
  6283. ˛ÄÚÌ
  6284. ˛ÄÚÌŸŸŸŸŸŸŸŸŸŸŸ ¸ įÑ>Ä˝IJÄ˙ ¸ Ä$F  @IJÄ˝Ä˙ ¸ Ä$%†@IJÄ˝Ä˙"¸èÄ$%†@ɘ9¿«« õáû pÛŒ˚"¸ëD%º ¸»àÑÉ2Ç í†H° °    (˚"¸ëD$•»Ç àHàºÇÇ'†√»øøyË˚"¸ëD$§Ç àHàƒÇÇ(†ƒH††â˚"¸ìDD§ å»àÃÉ2    É)ê§…êêô2˚"¸ç'ÑD<@Éà¥@¬ÇΔéõFééh—»˚˚˛ ˝@˙˝Äˆ˚˛ ˝@˙˛ı˚ ˛˝Ä˙˛ı!¸ @Ä  ˛ Å Ä/ÄÄ˙!¸ Ä  ˛(IJ¡Ä˙!¸ Ä
  6285. ( ˛H@˛¢Ä˙%¸ÃGº
  6286. +Ü/8√, <aè<å<HOE‡¢úx·Ô8˛%¸2H¬
  6287. (I(ì4≤Bñhëë(≥"àP≈&¢ÇD0†˛%¸(H˛    K–(í"(ë(°"à_©CîûDÚ?†˛%¸&H¿    LP(í¢A(ë(°"àP)Bî¢E0 ˛%¸"I†    L»(ì0¢ Ühì(≥#à)!î¶E2h ˛%¸<FúãG(à«"Nqàçç$å#‡àöD—ß ˛
  6288. ÒÄÔ ˝
  6289. ÒÄÔ@˝flÄ˝¸Ä¿¸Í¸Ä˝ Í¸Ä˝ Í¸
  6290.     <ûÁàÛŒ<`ϸ
  6291.     "°ëH§("êϸ ë"øëHßË#θ ë"†ëH§#θ
  6292. ô2êëH¢"Äϸ
  6293.  V,éΔáë»Å"pÏ˚ ˝È˚ ˝È ˚ ˝Ê¸å#˛$Ä͸êà$˛$Ä̸†à(˛$Ä̸¡«rà0D˜¿$¢g;úcÄÔ¸¿$Dà0DàÄ$¢í IöÓ¸°‰D(Dâ$¢B#…
  6294. Ó¸í$DÄ$Dâ$¢2$I
  6295. Ó¸ädHÄ"Dä$¢$…öÓ¸@Ö§HÇ!<è»$û·#DbÓÛËÛËŸ
  6296. ¸Ä˝¿ Á¸Ä PÁ¸Ä àÁ¸ë7;úa¿ àÁ¸ëJ Iô¿àÁ¸ë"#…     àÁ¸ë$I     àÁ¸ë
  6297. $…ô PÁ¸èq#Daƒ ÁŸŸŸò(W5W5wä–®ŸŸ=Ä˙`˙¿Ôf˘``˙`Ôaˇ˙{w‡˙~˛ÁÚ=øÄ˚cˇ`˙fi˚ø¯ÚÏ˙c«`˙€∑¿Ú}ˇÄ˚c‡˙fiÔxÚÎÎŸŸŸ
  6298. ¿ÒˇÌ  ÄÚÌ  ÄÚÌ  ÄÚÌ  ÄÚÌ ¿ÄÚÌ
  6299. ˛ÄÚÌ
  6300. ˛ÄÚÌ
  6301. ˛ÄÚÌ
  6302. ˛ÄÚÌ
  6303. ˛ÄÚÌ˛    Äp ˛@˛    ÄH ˛@˛ÄKÁ7áqØú√1ÿ\‹˛Är4ÃÜDöp‰ |“§˛ÄJ‘ƒÜDÍ+eJ`R§˛Ärtºáá9‹„±‹,ú˛Ä˚¸Ì˛Ä˚8¸Ì˛Ä˚˘Ì
  6304. ˛ÄÚÌ
  6305. ˛ÄÚÌ
  6306. ˛ÄÚÌ
  6307. ˛ÄÚÌ
  6308. ˛ÄÚÌ
  6309. ˛ÄÚÌ ¿ÄÚÌ
  6310.  Òˇ¯Ì  ÄÚÌ ¿ÄÚÌ ÄÚÌ ‡ÄÚÌ
  6311. ˛ÄÚÌ
  6312. ˛ÄÚÌ
  6313. ˛ÄÚÌ
  6314. ˛ÄÚÌ
  6315. ˛ÄÚÌ
  6316. ˛ÄÚÌ˛Ä¸8¿¸˛Ä¸$ ¸˛Ä¸$◊3 ¸\‹˛Ä¸%ıOÖ ¸“§˛Ä¸%D ¸R§˛Ä¸8È;Ö¿¸,ú
  6317. ˛ÄÚÌ
  6318. ˛ÄÚÌ
  6319. ˛ÄÚÌ
  6320. ˛ÄÚÌ
  6321. ˛ÄÚÌ
  6322. ˛ÄÚÌ
  6323. ˛ÄÚÌ
  6324. ˛ÄÚÌ
  6325. ˛ÄÚÌ @ÄÚÌ
  6326. ¿Òˇ¯Ì @ÄÚÌ ‡ÄÚÌ @ÄÚÌ @ÄÚÌ
  6327. ˛ÄÚÌ
  6328. ˛ÄÚÌ
  6329. ˛ÄÚÌ
  6330. ˛ÄÚÌ
  6331. ˛ÄÚÌ
  6332. ˛ÄÚÌ
  6333. ˛ÄÚÌ
  6334. ˛ÄÚÌ
  6335. ˛ÄÚÌ
  6336. ˛ÄÚÌ
  6337. ˛ÄÚÌ
  6338. ˛ÄÚÌ
  6339. ˛ÄÚÌ
  6340. ˛ÄÚÌ
  6341. ˛ÄÚÌ
  6342. ˛ÄÚÌ
  6343. ˛ÄÚÌ
  6344. ˛ÄÚÌ˛ÄÚ˛Ú˛Äڲڲĸ9¥˚Œq+gڲĸí‰˚)ël…Ú˛Ä˚êê˚)ꨅÚ˛Ä˚2O–˚…pìGÚ
  6345. ˛ÄÚ
  6346. ˛ÄÚ‡
  6347. ˛ÄÚÌ
  6348. ˛ÄÚÌ
  6349. ˛ÄÚÌ
  6350. ˛ÄÚÌ
  6351. ˛ÄÚÌ
  6352. ˛ÄÚÌ
  6353. ˛ÄÚÌ
  6354. ˛ÄÚÌ
  6355. ˛ÄÚÌ
  6356. ˛ÄÚÌ
  6357. ˛ÄÚÌ
  6358. ˛ÄÚÌ
  6359. ˛ÄÚÌ
  6360. ˛ÄÚÌ
  6361. ˛ÄÚÌ
  6362. ˛ÄÚÌ
  6363. ˛ÄÚÌ
  6364. ˛ÄÚÌ
  6365. ˛ÄÚÌ
  6366. ˛ÄÚÌ
  6367. ˛ÄÚÌ ¿ÄÚÌ
  6368.  Òˇ¯Ì  ÄÚÌ ¿ÄÚÌ  ÄÚÌ ¿ÄÚÌ
  6369. ˛ÄÚÌ
  6370. ˛ÄÚÌ
  6371. ˛ÄÚÌ
  6372. ˛ÄÚÌ
  6373. ˛ÄÚÌ˛Ä˝sŸò #1‡˝˛Ä˝™&d d  ˝˛Ä˝b&d@§Àê˝\‹˛Ä˝;ÊdOÙ∫P˝“§˛Ä˝™&d@$äP˝R§˛Ä˝rò@#qê˝,ú˛Ä˝   ˝Ì˛Ä˙  ˝Ì
  6374. ˛ÄÚÌ
  6375. ˛ÄÚÌ
  6376. ˛ÄÚÌ
  6377. ˛ÄÚÌ
  6378. ˛ÄÚÌ
  6379. ˛ÄÚÌ
  6380. ˛ÄÚÌ 0ÄÚÌ
  6381. HÒˇ¯Ì HÄÚÌ HÄÚÌ HÄÚÌ 0ÄÚÌ
  6382. ˛ÄÚÌ
  6383. ˛ÄÚÌ
  6384. ˛ÄÚÌ
  6385. ˛ÄÚÌ
  6386. ˛ÄÚÌ
  6387. ˛ÄÚÌ
  6388. ˛ÄÚÌ
  6389. ˛ÄÚÌ
  6390. ˛ÄÚÌ
  6391. ˛ÄÚÌ
  6392. ˛ÄÚÌ
  6393. ˛ÄÚÌ
  6394. ˛ÄÚÌ
  6395. ˛ÄÚÌ
  6396. ˛ÄÚÌ
  6397. ˛ÄÚÌ
  6398. ˛ÄÚÌ
  6399. ˛ÄÚÌ
  6400. ˛ÄÚÌ˛Ä˙˙˛Ú˛Äڲڲĸ€5ú˚Œq+gڲĸæ~R˚)ël…ڲĸ¢nR˚)ꨅڲĸ5í˚…pìGÚ
  6401. ˛ÄÚ
  6402. ˛ÄÚ‡
  6403. ˛ÄÚÌ
  6404. ˛ÄÚÌ
  6405. ˛ÄÚÌ
  6406. ˛ÄÚÌ
  6407. ˛ÄÚÌ
  6408. ˛ÄÚÌ
  6409. ˛ÄÚÌ
  6410. ˛ÄÚÌ
  6411. ˛ÄÚÌ
  6412. ˛ÄÚÌ
  6413. ˛ÄÚÌ
  6414. ˛ÄÚÌ
  6415. ˛ÄÚÌ
  6416. ˛ÄÚÌ
  6417. ˛ÄÚÌ
  6418. ˛ÄÚÌ
  6419. ˛ÄÚÌ
  6420. ˛ÄÚÌ
  6421. ˛ÄÚÌ
  6422. ˛ÄÚÌ ÄÚÌ
  6423. 0Òˇ¯Ì PÄÚÌ xÄÚÌ ÄÚÌ ÄÚÌ
  6424. ˛ÄÚÌ
  6425. ˛ÄÚÌ
  6426. ˛ÄÚÌ
  6427. ˛ÄÚÌ
  6428. ˛ÄÚÌ
  6429. ˛ÄÚÌ˛Ä˚˘˛Ä˚˘˛Ä˚;ú¿˚\‹˛Ä˚‡˚“§˛Ä˚e†˚R§˛Ä˚‹¿˚,ú˛Ä˙˙Ì˛Ä˙8˙Ì
  6430. ˛ÄÚÌ
  6431. ˛ÄÚÌ
  6432. ˛ÄÚÌ
  6433. ˛ÄÚÌ
  6434. ˛ÄÚÌ
  6435. ˛ÄÚÌ
  6436. ˛ÄÚÌ 0ÄÚÌ
  6437. HÒˇ¯Ì HÄÚÌ 0ÄÚÌ HÄÚÌ 0ÄÚÌ
  6438. ˛ÄÚÌ
  6439. ˛ÄÚÌ
  6440. ˛ÄÚÌ
  6441. ˛ÄÚÌ
  6442. ˛ÄÚÌ
  6443. ˛ÄÚÌ˛Ä¸˛¸Ì˛Ä¸˛¸Ì˛Ä˛Ê:ŸÏg0˝Ì˛Ä˝óC^ôx˝Ì˛Ä˝ÌæˆLg∞˝Ì˛Ä˝Ä¿˙Ì˛Ä˛¿Ä˙Ì
  6444. ˛ÄÚÌ
  6445. ˛ÄÚÌ
  6446. ˛ÄÚÌ
  6447. ˛ÄÚÌ
  6448. ˛ÄÚÌ
  6449. ˛ÄÚÌ
  6450. ˛ÄÚÌ
  6451. ˛¯ÚÌ
  6452. ˛0ÚÌ
  6453. ˛0ÚÌ
  6454. ˛`Ú Ì
  6455. ˛‡ÚÌ ¿Ú8Ì ÄÚ0Ì ÄÚpÌ
  6456. Ò‡Ì
  6457. Ò¿Ì ÄÛÌ
  6458. ˛ÄÚÌ
  6459. ˛ÄÚÌ
  6460. ˛ÄÚÌ
  6461. ˛ÄÚÌ
  6462. ˛ÄÚÌ
  6463. ˛ÄÚÌ
  6464. ˛ÄÚÌ
  6465. ˛ÄÚÌ
  6466. ˛ÄÚÌ
  6467. ˛ÄÚÌŸŸŸŸŸŸŸŸŸŸŸ ¸ įÑ>Ä˝IJÄ˙ ¸ Ä$F  @IJÄ˝Ä˙ ¸ Ä$%†@IJÄ˝Ä˙"¸èÄ$%†@ɘ9¿«« õáû pÛŒ˚"¸ëD%º ¸»àÑÉ2Ç í†H° °    (˚"¸ëD$•»Ç àHàºÇÇ'†√»øøyË˚"¸ëD$§Ç àHàƒÇÇ(†ƒH††â˚"¸ìDD§ å»àÃÉ2    É)ê§…êêô2˚"¸ç'ÑD<@Éà¥@¬ÇΔéõFééh—»˚˚˛ ˝@˙˝Äˆ˚˛ ˝@˙˛ı˚ ˛˝Ä˙˛ı!¸ @Ä  ˛ Å Ä/ÄÄ˙!¸ Ä  ˛(IJ¡Ä˙!¸ Ä
  6468. ( ˛H@˛¢Ä˙%¸ÃGº
  6469. +Ü/8√, <aè<å<HOE‡¢úx·Ô8˛%¸2H¬
  6470. (I(ì4≤Bñhëë(≥"àP≈&¢ÇD0†˛%¸(H˛    K–(í"(ë(°"à_©CîûDÚ?†˛%¸&H¿    LP(í¢A(ë(°"àP)Bî¢E0 ˛%¸"I†    L»(ì0¢ Ühì(≥#à)!î¶E2h ˛%¸<FúãG(à«"Nqàçç$å#‡àöD—ß ˛
  6471. ÒÄÔ ˝
  6472. ÒÄÔ@˝flÄ˝¸Ä¿¸Í¸Ä˝ Í¸Ä˝ Í¸
  6473.     <ûÁàÛŒ<`ϸ
  6474.     "°ëH§("êϸ ë"øëHßË#θ ë"†ëH§#θ
  6475. ô2êëH¢"Äϸ
  6476.  V,éΔáë»Å"pÏ˚ ˝È˚ ˝È ˚ ˝Ê¸å#˛$Ä͸êà$˛$Ä̸†à(˛$Ä̸¡«rà0D˜¿$¢g;úcÄÔ¸¿$Dà0DàÄ$¢í IöÓ¸°‰D(Dâ$¢B#…
  6477. Ó¸í$DÄ$Dâ$¢2$I
  6478. Ó¸ädHÄ"Dä$¢$…öÓ¸@Ö§HÇ!<è»$û·#DbÓÛËÛËŸ
  6479. ¸Ä˝¿ Á¸Ä PÁ¸Ä àÁ¸ë7;úa¿ àÁ¸ëJ Iô¿àÁ¸ë"#…     àÁ¸ë$I     àÁ¸ë
  6480. $…ô PÁ¸èq#Daƒ ÁŸŸŸˇJ@ˇ ˇˇˇˇ@
  6481. ˇ·ˇ‚7^
  6482. 4*\˜, Palatino
  6483. .+l"CHAPTER œ´)\2,     Helvetica
  6484.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6485. (‡*2 )-c)28
  6486.     )9W’ê))riting a Chooser-Compatible Device Driver
  6487. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6488. 1/91(¯l Second line.4^*¿¯
  6489. g*n¯4g*n¯ jlj¯
  6490. ˇ·ˇ‚7^
  6491.     °dONLNdˇˇ(dl    Table 2-2°dONLNd\™gÒ)>Device package flÑê°dONLNd\Ògˇ)Gags°dONLNdulw(|lBit°dONLNduÆ“)BMeaning
  6492. °dONLNd#Élév(ãl31°dONLNd&ÉÆé”)B
  6493. Set if an ˚°dONLNd0É”éÙ)%AppleTÆ@°dONLNd6ÉÙé )!
  6494. alk device°dONLNdBêlõÖ(òl30–29°dONLNdHêÆõ)BReserved (clear to 0)°dONLNd_ùl®v(•l28°dONLNdbùÆ®ø)B?Set if the device package can have multiple instances selected ‰¿°dONLNd¢ùø®fi(•øat once°dONLNd´™lµv(≤l27°dONLNdƙƵt)B.Set if the device package uses the Left button°dONLNdfi∑l¬v(øl26°dONLNd·∑Ƭ{)B/Set if the device package uses the Right button°dONLNdƒlœv(Ãl25°dONLNdƒÆœI)B"Set if no zone name has been saved°dONLNd9—l‹v(Ÿl24°dONLNd<—Æ‹s)B,Set if device package uses actual zone names°dONLNdjfilÈÖ(Êl23–21°dONLNdpfiÆÈ)BReserved (clear to 0)°dONLNdáÎlˆv(Ûl20°dONLNdäÎÆˆ:)B Set if device uses the On and Of˙İdONLNd™Î:ˆ‡)å&f radio buttons and radio button label°dONLNd“¯lÖ(l19–17°dONLNdÿ¯Æ)BReserved (clear to 0)°dONLNdÔlv(
  6495. l17.°dONLNdÚÆL)B"Set if device package accepts the ,
  6496. Courier°dONLNdLd)ûinit°dONLNddå) message.°dONLNd"lv(l16.°dONLNd%ÆL)B"Set if device package accepts the °dONLNdGLp)ûnewSel°dONLNdMpò)$ message.°dONLNdWl*v('l15.°dONLNdZÆ*L)B"Set if device package accepts the °dONLNd|L*|)ûfillList°dONLNdÑ|*§)0 message.°dONLNdé,l7v(4l14.°dONLNdë,Æ7L)B"Set if device package accepts the °dONLNd≥+L7p)ûgetSel°dONLNdπ,p7ò)$ message.°dONLNd√9lDv(Al13.°dONLNdΔ9ÆDL)B"Set if device package accepts the °dONLNdË8LDp)ûselect°dONLNdÓ9pDò)$ message.°dONLNd¯FlQv(Nl12.°dONLNd˚FÆQL)B"Set if device package accepts the °dONLNdELQ|)ûdeselect°dONLNd%F|Q§)0 message.°dONLNd/Sl^q([l1Û`°dONLNd0Sp^u)1.°dONLNd2SÆ^L)>"Set if device package accepts the °dONLNdTRL^Ç)û    terminate°dONLNd]SÇ^™)6 message.°dONLNdg`lkÄ(hl10–0°dONLNdl`Æk)BReserved (clear to 0)
  6497. û*§¯4ü*§¯ ülü¯
  6498. ˇ·ˇ‚7^
  6499. ˇˇ◊ˇ◊°dONLNdÑélû,(ölResponding to the Chooser ˇˇˇˇˇˇ•(ö2
  6500. °dONLNdü•l∞Œ(≠lThis section gives mor2‡°dONLNdµ•œ∞™)c0e details about how your device package should rq °dONLNd•™∞)€espond when it °dONLNdÙ±lºo(πlrE°dONLNdı±pº»)eceives a message frÁ°dONLNd    ±»º
  6501. )Xom the Chooser °dONLNd±º)F.°dONLNd√lŒ÷(ÀlMWhen the Chooser sends your device package a message, the Chooser extension fi∞†°dONLNdg√÷ŒÈ(À÷le is °dONLNdmœl⁄é(◊lthe curr `°dONLNduœè⁄£)#ent r.¿°dONLNdzœ£⁄ª)esourw°dONLNdœª⁄Ã)ce fi=†°dONLNdÑœÕ⁄e)"le, the Chooser window is the currD`°dONLNd¶œe⁄Â)òent grafPort, and the System °dONLNd√€lÊπ(„lFolder of the currö¿°dONLNd’€πÊc)M(ent startup disk is the default volume. Ô °dONLNd˝€cÊi)™Y؆°dONLNd˛€iÊŸ)our device package must °dONLNdÁlÚu(ÔlprG °dONLNdÁvÚΔ)
  6502. eserve all of these.°dONLNd-˘lr(lTµ¿°dONLNd.˘qì)able 2-3√@°dONLNd6˘ìö)"9 lists the Chooser messages and how your package should rflİdONLNdo˘ö„(öespond to them. ˇ@ˇ ˇˇˇˇ@
  6503. ˇ·ˇ‚7^
  6504. 4H\, Palatino
  6505. .+ä"CHAPTER œ´)\2,     Helvetica
  6506.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê))riting a Chooser-Compatible Device Driver
  6507. ~¿(‡2
  6508. ‡)-a¿)29
  6509. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6510. 1/91(¯ä Second line.4^H¿
  6511. gHn4gHn jäj
  6512. ˇ·ˇ‚7^
  6513.     °dONLNdˇˇ(dä    Table 2-3°dONLNd\»gd)>#Chooser messages and their meanings°dONLNd%tä∞(|äMessage°dONLNd-tÓ)dMeaning,
  6514. Courier
  6515. .°dONLNd6Çâé°(ãâinit.°dONLNd;ÉÓé    )e=The Chooser sends this message to your package when the user °dONLNdxëÓú6*selects the icon rÍ °dONLNdäë6úD)Heprz‡°dONLNdçëEú),esenting your package in the icon list. The .°dONLNdπûÓ™(ßÓobjName°dONLNd¿ü™›)*+ parameter contains a pointer to a data strl°dONLNdÎü›™Û)≈uctur>`°dONLNdüÛ™)e that .°dONLNd˜≠Ó∏B(µÓcontains a size worp¿°dONLNd
  6516. ≠B∏·)T#d followed by four handles to Contr}°dONLNd-≠·∏)üolRecor˝@°dONLNd4≠∏
  6517. )!d °dONLNd6ªÓΔ(√Ódata strº °dONLNd>ªΔ&)!ucturB°dONLNdCª'Δ)8es. The size is at least 18 bytes (2 bytes for the size °dONLNd{…Ó‘ˇ(—ÓworİdONLNd~…‘Ê)5d and 4 bytes for each of the handles). The handles r¿°dONLNd≥…Ê‘ˆ)Êefer√‡°dONLNd∑…ˆ‘ )ence °dONLNdº◊Ó‚∑(flÓ,the Left and Right buttons and the On and Of}¿°dONLNdË◊∑‚)…f radio buttons in °dONLNd˚ÂÓ (ÌÓthat orꆰdONLNd )der´@°dONLNdÂ). }†°dONLNdÂ$)Y> °dONLNdÂ$r)our package can ré@°dONLNdÂr)N"espond to this message by setting °dONLNd;ÛÓ˛^(˚Óup the initial button confi: °dONLNdVÛ_˛ê)q guration. Tj`°dONLNdaÛè˛)0o display one of the radio .°dONLNd|Ó g(    Óbuttons, you must call the °dONLNdóg ©)y ShowControl°dONLNd¢© ∞)B rR`°dONLNd§∞ Û)outine for it. Tg`°dONLNd¥Ú ˙)Bo ˇˇ°dONLNd∂Óã(Ó"highlight them, you must call the ˇ˛
  6518. "ûf°dONLNdÿãÕ)ù SetCtlValueˇˇûf°dONLNd„Õ”)B ru◊°dONLNd”)outine. See the °dONLNdıÓ(H(%Óchapter “The ContrR`°dONLNdH(•)Zol Manager” for mor$¿°dONLNd•(˛)]e information. The $¿°dONLNd-˛(
  6519. )Yp2$¿°dONLNd/
  6520. (
  6521. )  .°dONLNd0+Ó6P(3Óparameter is not used..°dONLNdH>âJ≠(GânewSel.°dONLNdO?ÓJ)e?If your device package allows multiple selections, the Chooser °dONLNdéMÓX*=sends this message to your packages when the user changes or .°dONLNdÀ[ÓfS*adds a selection. The °dONLNd·ZSf})eobjName°dONLNdË[}fî)* and °dONLNdÌZîf†)p2°dONLNdÔ[†f‰)  parameters arR`°dONLNd˝[‰f)D e not used.°dONLNd
  6522. nâzπ(wâfillList.°dONLNdoÓz)e>The Chooser sends this message when the user selects a device ˇˇj®.°dONLNdQ}Óà*
  6523. icon. The ˇ˛’PUP°dONLNd[|à&),p1ˇˇj®UP°dONLNd]}&à) 5 parameter contains a handle to a List Manager list. .°dONLNdíãÓñÙ(ìÓY@İdONLNdìãÙñ›)3our device package should use the List Manager to fiå@°dONLNd«ã›ñ)È
  6524. ll this list .°dONLNd‘ôÓ§∫(°Ó,with choices for the particular device. The °dONLNdò∫§‰)ÃobjName°dONLNdô‰§˚)* and °dONLNd ò˚§)p2°dONLNdô§
  6525. )  .°dONLNdßÓ≤+(ØÓ
  6526. parameters arì°dONLNdß+≤Z)= e not used.°dONLNd)ªâΔ£(√âgetSel°dONLNd0ªÓΔ˜)e:The Chooser sends this message to determine which entries °dONLNdj…Ó‘
  6527. *Ashould be selected. The p1 parameter contains a handle to a List °dONLNd´◊Ó‚**Manager list. ¥Ä°dONLNdπ◊*‚0)<Yu°dONLNd∫◊0‚¨)our device package should r@İdONLNd’◊≠‚
  6528. )}espond by inspecting °dONLNdÍÂÓ(ÌÓCthe list and setting the selected or unselected state of each entryQİdONLNd-Â
  6529. (Ì, ˇˇ.°dONLNd/ÛÓ˛(˚Ó
  6530. using the ˇ˛8∏°dONLNd9Ú˛U)+
  6531. LSetSelectˇˇ∏°dONLNdCÛU˛Ä)<  function. ¬ú°dONLNdNÛIJá)+Y◊ú°dONLNdOÛܲ)!ou should alter only the entries .°dONLNdpÓ (    Óthat r °dONLNdv )equir2`°dONLNd{ )7e updating. The Chooser does not send this message for °dONLNd≤Ó0(Óserial printers. °dONLNd≈#â.°(+âselect°dONLNdÃ#Ó.)e?If your device package does not allow multiple selections, the °dONLNd 1Ó<˙*:Chooser sends this message to your packages when the user °dONLNdE?ÓJ;*selects a device fro°dONLNdX?;Jç)Mom the device list. Ê@°dONLNdl?çJì)RY¶¿°dONLNdm?ìJ≈) ou should rwİdONLNdx?ΔJÿ)3ecor·°dONLNd|?ÿJ)
  6532. d the user¢¿°dONLNdÜ?J)-’s °dONLNdâMÓX#(UÓ
  6533. selection, pr·†°dONLNdñM#XΔ)5$eferably in your Chooser extension fi‡°dONLNdªM«X”)§le. å@°dONLNdøM”XŸ) YL¿°dONLNd¿MŸX
  6534. ) our device °dONLNdÀ[Óf™(cÓ*package may not call the List Manager in ry@°dONLNdı[™f)ºesponse to this message..°dONLNdoÓz](wÓIf your package accepts °dONLNd(n]zç)ofillList°dONLNd0oçz“)0 messages, the °dONLNd?n“z¸)EobjName°dONLNdFo¸zˇ)* °dONLNdG}ÓàH(ÖÓparameter is undefi°dONLNdZ}HàÇ)Z ned and the °dONLNdf|Çàé):p2°dONLNdh}éàˆ)  parameter gives the rR`°dONLNd~}ˆà)how .°dONLNdÅãÓñt(ìÓnumber of the selected device..°dONLNd¢üÓ™Å* If your package does not accept °dONLNd¬ûÅ™±)ìfillList°dONLNd ü±™ˆ)0 messages, the °dONLNdŸ¨Ó∏(µÓobjName°dONLNd‡≠∏)*6 parameter contains a pointer to a string of up to 32 ˇL@ˇ ˇˇˇˇ@
  6535. ˇ·ˇ‚7^
  6536. 4*\˜, Palatino
  6537. .+l"CHAPTER œ´)\2,     Helvetica
  6538.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6539. (‡*2 )-c)30
  6540.     )9W’ê))riting a Chooser-Compatible Device Driver
  6541. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6542. 1/91(¯l Second line.4^*¿¯
  6543. °dONLNd]–hÚ(e–Echaracters that contains the name of the device. If the device is an ˇ˝Ô÷.°dONLNdEk–v4*Appletalk device, the ,
  6544. Courierˇ˚fl¨OǰdONLNd[j5vA)ep2ˇ˝Ô÷OǰdONLNd]kAvú)  parameter gives the ∞z°dONLNdrkúv˜)[AddrBlock value for .°dONLNdÜy–Ñı(Å–the addrŸ‡°dONLNdéyıÑF)%ess of the selected ∂İdONLNd¢yFÑg)QAppleTi¿°dONLNd®ygÑ·)!alk device. (See the chapter °dONLNd≈á–íˆ(è–“AppleT3@°dONLNdÃáˆí,)& alk” for moru@°dONLNdÿá,ím)6e information.).°dONLNdÈök¶õ(£kdeselect.°dONLNdÚõ–¶‚)e?If your device package does not allow multiple selections, the °dONLNd1©–¥‹*:Chooser sends this message to your packages when the user °dONLNdk∑–¬m*'deselects a device in the device list. #°dONLNdí∑n¬t)ûY„İdONLNdì∑s¬Ò)our device package may not °dONLNdÆ≈––>(Õ–call the List Manager in r≤†°dONLNd»≈>–©)nesponse to this message..°dONLNd„Ÿ–‰?(·–If your package accepts °dONLNd˚ÿ?‰o)ofillList°dONLNdŸo‰¥)0 messages, the °dONLNdÿ¥‰fi)EobjName°dONLNdŸfi‰·)* °dONLNdÁ–Ú*(Ô–parameter is undefi°dONLNd-Á*Úd)Z ned and the °dONLNd9ÊdÚp):p2°dONLNd;ÁpÚÿ)  parameter gives the rR`°dONLNdQÁÿÚË)how .°dONLNdTı–V(˝–number of the selected device..°dONLNdu    –c* If your package does not accept °dONLNdïcì)ìfillList°dONLNdù    ìÿ)0 messages, the °dONLNd¨–"˙(–objName°dONLNd≥˙"Ó)*7 parameter contains a pointer to a string (of up to 32 .°dONLNdÍ%–0Ï(-–Ccharacters) containing the name of the device. If the device is an ˇ˛ˇ˛.°dONLNd-3–>7*Appletalk device, the ˇ˝ˇ¸˙°dONLNdC28>D)hp2ˇ˛ˇ˛˙°dONLNdE3D>£)  parameter gives the ˇ˝ˇ¸Ú°dONLNdZ2§>⁄)`    AddrBlockˇ˛ˇ˛Ú°dONLNdc3⁄>˜)6 value .°dONLNdjA–L(I– for the addr‡°dONLNdvALV)5ess of the selected ÚİdONLNdäAULv)PAppleT•¿°dONLNdêAvL)!alk device. (See the chapter °dONLNd≠O–Zˆ(W–“AppleT3@°dONLNd¥OˆZ,)& alk” for moru@°dONLNd¿O,Zm)6e information.).°dONLNd—bkn°(kk    terminate.°dONLNd€c–n’)e:The Chooser sends this message when the user selects a difV`°dONLNdc’n·(k’fer8‡°dONLNdc·nÒ) ent °dONLNdq–|Ä(y–&device icon, closes the Chooser windowó °dONLNdBq|‘)Ø, or changes zones. «‡°dONLNdVq‘|⁄)UYà`°dONLNdWq⁄|Î)our °dONLNd[–äÛ(á–@device package should perform any necessary clean-up tasks, but .°dONLNdõç–òì*+should not dispose of the device list. The °dONLNdΔåìòΩ)√objName°dONLNdÕçΩò‘)* and °dONLNd“å‘ò‡)p2°dONLNd‘ç‡ò„)  .°dONLNd’õ–¶
  6545. (£–
  6546. parameters arì°dONLNd‚õ
  6547. ¶<)= e not used..°dONLNdÔÆk∫è(∑kbutton.°dONLNdˆØ–∫Î)e?The Chooser sends this message when the user clicks one of the .°dONLNd5Ω–»^*buttons in the Chooser windowï°dONLNdRΩ]»ï)ç . The low-org`°dONLNd^Ωï»›)8der byte of the g`°dONLNdnº›»È)Hp2g`°dONLNdpΩÈ»Ï)  .°dONLNdqÀ–÷≈(”–:parameter contains 1 if the user clicked the Left button, t`°dONLNd´ÀΔ÷Ê)ˆ    2 if the °dONLNd¥Ÿ–‰Ê(·–Buser clicked the Right button, 3 if the user clicked the On radio °dONLNdˆÁ–Úy*(button, and 4 if the user clicked the Off¿°dONLNdÁyÚª)©f radio button. S†°dONLNd.ÁªÚ¡)BY °dONLNd/Á¡ÚÁ)ou must °dONLNd7ı–(˝–perform the appru°dONLNdGıÍ)L0opriate highlighting for the radio buttons. The °dONLNdw–( –high-or(†°dONLNd~Ò)!der wor °dONLNdÖø)#&d of this parameter contains the modifiÈ`°dONLNd¨ø„)´
  6548. er bits fr≠‡°dONLNd∂‰Ù)%om °dONLNdπ–ß(–/the mouse up event. See the chapters “The Contr€‡°dONLNdËßÙ)◊ol Manager” and °dONLNd¯–*T('–“The Event Manager” for mor7†°dONLNdU*ì)Öe information.
  6549. Q*W¯4R*W¯ RlR¯
  6550. ˇ·ˇ‚7^
  6551. ˇˇ◊ˇ◊°dONLNd"AlQ(MlAllocating private storageˇˇˇˇˇˇ•(M2
  6552. °dONLNd=Xlct(`l<Device packages initially have no data space allocated. Ther—†°dONLNdyXtcÑ(`te ar‡@°dONLNd}XÑcˆ)e two ways your package °dONLNdïdloô(ll
  6553. can acquirˇÄ°dONLNdüdôo—)-
  6554. e data space:,
  6555.  
  6556. Zapf Dingbats
  6557. °dONLNd≠xlq(~ln
  6558. °dONLNdØvxÅì) AUse the List Manager to allocate extra memory in the device list.
  6559. °dONLNdÒälëq(êln
  6560. °dONLNdÛàxìÉ) Cr\°dONLNdıàÉì¢) eate a rˆ†°dONLNd˝à¢ì∫)esour>‡°dONLNdàªìΔ)ce.°dONLNdöl•N(¢l4The Chooser uses column 0 of the device list to stor‰@°dONLNd:öN•Û)‚'e the names displayed in the list box; ˇˇ2⁄.°dONLNda¶l±(Æl'for device packages that do not accept ˇ˛e¥„ˆ°dONLNdà•±K)ØfillListˇˇ2⁄„ˆ°dONLNdê¶K±fi)0# messages, it uses column 1 to storL°dONLNd≥¶fl±¯)îe the .°dONLNdπ≤lΩâ(∫l4-byte @°dONLNd¿≤äΩ´)AppleTÀİdONLNdΔ≤™ΩÙ) alk internet addr’@°dONLNd◊≤ÙΩé)J&esses of the devices in the list. Ther °dONLNd˝≤èΩ†)õeforq °dONLNd    ≤†Ω‡)e, your device ˇ!<@ˇ ˇˇˇˇ@
  6561. ˇ·ˇ‚7^
  6562. 4H\, Palatino
  6563. .+ä"CHAPTER œ´)\2,     Helvetica
  6564.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Desk ◊`)4    Accessory
  6565. ~¿(‡2
  6566. ‡)-a¿)31
  6567. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6568. 1/91(¯ä Second line.4^H¿
  6569. .°dONLNd]ähu(eä3package can use column 1 and higher (if it accepts ,
  6570. Courier°dONLNd3\uh•)ÎfillList°dONLNd;]•h)0 messages) or column 2 .°dONLNdRiätÿ(qäand higher to stor5`°dONLNddiŸt)Oe private data. 懰dONLNdtit )AY`°dONLNdui tr)ou can use standar¸‡°dONLNdáirtª)Rd List Manager rs °dONLNdóiºt˝)Joutines to add °dONLNd¶uäÄfl(}äthese columns, storUİdONLNdπuflÄ:)Ue data in them, and röİdONLNdŒu:Äë)[etrieve the data stor0`°dONLNd„uíı)Xed ther8 °dONLNdÍu±Ä∫)e. ‘ °dONLNdÌu∫Ä¿)    YdONLNdÓu¿ÄÒ) our device .°dONLNd˘Åäåˇ(âäpackage can also use the °dONLNdġå#)urefCon°dONLNdÅ#å-)$ fi°dONLNdÅ-å)
  6571. ,eld of the device list for its own purposes..°dONLNdHìäû(õäZUsing the device list is limited by the fact that the Chooser disposes of the device list °dONLNd¢üä™í* :whenever the user changes device types or changes the curr`°dONLNd‹üì™Ê(ßìent zone. However‡°dONLNdÌüÊ™˚)S, the ˇˇ>ï.°dONLNdÛ´ä∂e(≥ä/Chooser does call your device package with the ˇ˛}*t®°dONLNd"™f∂ú)‹    terminateˇˇ>ït®°dONLNd+´ú∂‹)6 message beforƒ2°dONLNd9´‹∂)@e it disposes .°dONLNdG∑䬵(øä of the list.°dONLNdT…ä‘V*.Also, if your device package does not accept fi¡`°dONLNdÉ…V‘)Ã)llList messages, the Chooser disposes of °dONLNd¨’ä‡(›ä the device list whenever a new r‡°dONLNdÃ’‡F)è
  6572. esponse frÒ°dONLNd÷’E‡f),om the πİdONLNd›’f‡á)!AppleTl¿°dONLNd„’ᇫ)!alk zone interrr °dONLNdÚ’«‡)@ogation arrives. °dONLNd·äÏ≥(ÈäHowever †°dONLNd
  6573. ·≥ÏÕ))?, the Chooser does call the getSel message immediately afterwar∫@°dONLNdI·ÕÏŸ(ÈÕds.°dONLNdMÛä˛J(˚ä,The second way to get storage space is to crö °dONLNdyÛJ˛i)¿eate a r4¿°dONLNdÅÛj˛Ç) esour}°dONLNdÜÛDzÃ)ce in the device r¿‡°dONLNdòÛÃ˛‰)Jesour     °dONLNdùÛ²ˆ)ce fiœ¿°dONLNd¢Ûˆ˛)le. °dONLNd¶ˇä
  6574. •(äThis fi$@°dONLNd≠ˇ¶
  6575. ˛)le is always the currİdONLNd¬ˇ˛
  6576. )Xent r5‡°dONLNd«ˇ
  6577. *)esour~ °dONLNdÃˇ*
  6578. ;)ce fiD¿°dONLNd—ˇ<
  6579. ˇ)+le when the Chooser sends a message to the .°dONLNd¸ ä (äpackage, so you can use the °dONLNd
  6580.  M)Å GetResource°dONLNd# MT)B rR`°dONLNd% T))outine to obtain a handle to the storage..°dONLNdOä(L(%ä-It is important for most device packages to r    ‡°dONLNd|M(_)√ecor~@°dONLNdÄ_(    )&d which devices the user has chosen. Tà@°dONLNd¶    ()™o °dONLNd®)ä4¡(1ädo this, the rÏ¿°dONLNd∂)¡4A)7ecommended method is to cr5`°dONLNd–)B4a)Åeate a r–°dONLNdÿ)a4y)esour@°dONLNd›)z4 )ce in your driver r(İdONLNd) 4‚)Pesourp¿°dONLNdı)‚4Û)ce fi7`°dONLNd˙)Ù4)le. °dONLNd˛5ä@£(=äThis r‹Ä°dONLNd5£@ª)esour$¿°dONLNd    5º@¢)7ce can be of any type; in fact, it’s advantageous to prè°dONLNd@5¢@Ó)Êovide your own rY¿°dONLNdP5Ô@)Mesour¢°dONLNdU5@)ce °dONLNdXAäLÒ(Iätype so that no other pr˘`°dONLNdpAÒLÔ)g;ogram will try to modify it. If you choose to use a standar†°dONLNd´AL¯)ˇd °dONLNd≠MäXç(UärE°dONLNdÆMéX¶)esourç@°dONLNd≥M¶X*)ce type, you should use only r`°dONLNd—M+XC)ÖesourX†°dONLNd÷MCX¿)ce IDs in the range –4080 thrw‡°dONLNdÛM¿XÙ)} ough –4065.
  6581. ]Hx4^Hx
  6582. âHë4äHë äHä
  6583. ˇ·ˇ‚7^
  6584. ˇˇ£‰ˇÆ°dONLNdˇvHàX(ÑHWœ°dONLNdvXàª)riting a Desk …°dONLNdvªà
  6585. )c    Accessoryˇˇˇˇˇˇ⁄|(Ñ 2
  6586. °dONLNdöä•fi(¢äDesk accessories ar@°dONLNd+öfl•˛)UDe device drivers that act like small applications. Desk accessories °dONLNdo¶ä±Ω(Æä typically prS@°dONLNd{¶Ω±)3Fovide a user interface with a window and a menu, perform some limited °dONLNd¡≤äΩ–(∫äfunction, and ar¿`°dONLNd—≤–Ω)F e opened frö‡°dONLNd‹≤Ω#)2om the c`°dONLNd„≤#Ω)!0Apple menu. The Chooser is an example of a desk °dONLNdæä…¥(Δä    accessory†°dONLNdæ≥…µ)).°dONLNd–ä€Ê(ÿäDesk accessories wer3‡°dONLNd2–Á€Æ)]-e originally designed for the Macintosh envir4‡°dONLNd_–Æ€
  6587. )«onment because they °dONLNds‹äÁí(‰äof¿°dONLNdu‹ìÁü)    fer˛@°dONLNdx‹ûÁä) 5ed two distinct advantages over applications. They of`°dONLNd≠‹ãÁó)Ìfer‚‡°dONLNd∞‹ñÁ¯) ed both a limited degr«Ä°dONLNdΔ‹¯Á)bee of °dONLNdÃËäÛM(ä,multitasking and a primitive form of interprø¿°dONLNd¯ËMÛ⁄)√ocess communication. However&@°dONLNdË⁄Ûfl)ç, °dONLNdÙäˇ2(¸ä%applications under the system softwarO†°dONLNd;Ù3ˇÉ)©e version 7.0 envir÷†°dONLNdNÙɡ‚)Ponment enjoy far morö@°dONLNdbÙ„ˇÍ)`e °dONLNddä Á(äQsophisticated versions of these capabilities. Users can even open applications fru °dONLNdµÁ (Áom the °dONLNdº äı(äApple menu. For these r쇰dONLNd” ıÊ)k6easons, you would be better served by writing a small °dONLNd        ä#N( ä,application than by writing a desk accessory° °dONLNd    5M#R)√. °dONLNd    8*ä5™(2äIf you’rJ`°dONLNd    @*´5l)!,e certain you need to write a desk accessoryo¿°dONLNd    l*k5®)¿, you should rœ†°dONLNd    z*®5Ò)=ead this section. ©°dONLNd    å*Ò5˜)IYiİdONLNd    ç*˜5)ou °dONLNd    ê6äAŒ(>ämight want to rF‡°dONLNd    ü6œAâ)E(ead the chapters about the Event Manager!°dONLNd    «6âA®)∫, the WÒ¿°dONLNd    Œ6ßAÌ)
  6588. indow ManagerË`°dONLNd    €6ÌA)F, the °dONLNd    ·BäM—(JäDialog Managerg@°dONLNd    ÔB—M\)G, and the Menu Manager in the r@°dONLNd
  6589.  
  6590. B\M⁄)ãInside Macintosh: Macintosh Tƒ¿°dONLNd
  6591. *BŸMÚ)}oolbox}¿°dONLNd
  6592. 0BÛMı) °dONLNd
  6593. 1NäYœ(Vävolume as well.
  6594. ~HÑ4HÑ ä
  6595. ˇ·ˇ‚7^
  6596. ˇˇ◊ˇ◊°dONLNd
  6597. Anä~◊*$    How Desk ±;°dONLNd
  6598. Jn◊~:)M
  6599. Accessories WOM°dONLNd
  6600. Wn:~Q)corkˇˇˇˇˇˇ•)‘2
  6601. °dONLNd
  6602. [Öäêÿ(çäIn system softwar˝¿°dONLNd
  6603. lÖÿê()Ne version 7.0 envirÑ¿°dONLNd
  6604. Ö)ê)Q1onment, when the user opens a desk accessory (or .°dONLNd
  6605. ∞ëäúc(ôä,when an application calls the Menu Manager rR`°dONLNd
  6606. ‹ëcúÇ)Ÿoutine R`°dONLNd
  6607. „êÇúƒ) OpenDeskAccR`°dONLNd
  6608. Óëƒú)B
  6609. ) the system .°dONLNd
  6610. ˚ùä®Ê(•äswitches out the curr“`°dONLNd ùÊ®)\Dent application, loads the desk accessory into the system heap, and °dONLNd T©ä¥G(±ä+calls the desk accessory’s Open driver subrİdONLNd ©H¥’)æ outine. The desk accessory can r· °dONLNd ü©’¥)ç
  6611. espond by °dONLNd ©µä¿í(Ωäcrµ@°dONLNd ´µí¿)eating its window and menu. ˇ#@ˇ ˇˇˇˇ@
  6612. ˇ·ˇ‚7^
  6613. 4*\˜, Palatino
  6614. .+l"CHAPTER œ´)\2,     Helvetica
  6615.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6616. (‡*2 )-c)32
  6617.     )9W’ê)riting a Desk ◊`)4    Accessory
  6618. (ÔlDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6619. 1/91(¯l Second line.4^*¿¯
  6620. °dONLNd]lh¿(elWhen events occur    °dONLNd]¿h()T, the Event Manager dir`‡°dONLNd(](hÓ)h/ects them to the desk accessory by calling its °dONLNdWiltÖ(qlContrÂ@°dONLNd\iÖt¡)ol driver subr- °dONLNdji¬tÔ)=Aoutine. The Event Manager handles switching between applications °dONLNd´ulÄÔ(}lWand the desk accessories in the system heap and passing along the events meant for the °dONLNdÅlå≠* desk accessory± °dONLNdŨå:)@ . The desk accessory need only rΩİdONLNd0Å:åí)éespond to the Contr£`°dONLNdCÅíå†)Xol rF@°dONLNdGŰå¿)equest.°dONLNdOìlû⁄(õlRWhen the user closes the desk accessory (by closing its window or choosing Quit frÊ¿°dONLNd°ì⁄ûÍ(õ⁄om °dONLNd§ül™fi(ßlSits menu) or an application closes the desk accessory (by calling the Menu Manager .°dONLNd˜´l∂p* rR`°dONLNd¯´p∂è)outine ,
  6621. CourierR`°dONLNdˇ™è∂◊) CloseDeskAccR`°dONLNd ´◊∂Û)H>), the desk accessory disposes of its window (if any) and any .°dONLNdI∑l¬ß(ølother data strņ°dONLNdW∑߬æ);ucturİdONLNd\∑ø¬)es associated with it.°dONLNds…l‘Ë(—lIn a single-application envira °dONLNdê…Ë‘Z)|onment in system softwar·°dONLNd®…Z‘”)re version 6.0 or in multiple-°dONLNd≈’l‡∑(›lapplication envir•İdONLNd÷’∑‡Ú)K onment wher‘¿°dONLNd·’Ú‡—);4e the desk accessory is opened in the application’s °dONLNd·lÏ‹(ÈlRpartition (for example, when the user holds the Option key while opening the desk °dONLNdgÌl¯ü* accessory fr4@°dONLNds̆¯¡)4om the ¸¿°dONLNdzÌ¿¯Û) CApple menu), the Event Manager handles events for desk accessories °dONLNdΩ˘lÆ(lin a slightly dif @°dONLNdŒ˘Øª)CferÓ¿°dONLNd—˘∫Ï)
  6622. ent manner¡¿°dONLNd€˘Ï™)2., although it still translates them into Contr˚@°dONLNd    ˘™∏)æol rû °dONLNd
  6623. ˘π)
  6624. equests. See °dONLNdl(
  6625. l'the chapter “The Event Manager” in the §°dONLNdAù)≥Inside Macintosh: Macintosh TˆÄ°dONLNd^úµ)}oolboxØÄ°dONLNdd∂Î)  volume for °dONLNdplã(ldetails.°dONLNdy#l.n* 
  6626. S*Y¯4T*Y¯ TlT¯
  6627. ˇ·ˇ‚7^
  6628. ˇˇ◊ˇ◊°dONLNd{ClS|*$Crîø°dONLNd}C}S)eating a Driver ResourÔ°dONLNdìCSu)úce for a Desk ä°dONLNd°CvSº)]    Accessoryˇˇˇˇˇˇ•)z2
  6629. °dONLNd´Zler(blTµ¿°dONLNd¨ZqeÅ)o cr‡Ä°dONLNd∞ZÅefi)eate a desk accessoryÁ@°dONLNd≈Z›e)\
  6630. , you must crÇ¿°dONLNd“Zei):eate it as a driver r^`°dONLNdÁZieÅ)Resour¶†°dONLNdÏZÅefl)ce and include it in a °dONLNdflqo(nlrE°dONLNdfpqà)esourç@°dONLNd    fàqô)ce fiS‡°dONLNdföqÎ)le, as described in W@°dONLNd"fÎq˚)Q“Cr3@°dONLNd%f˚q^)eating a Driver Resour˘ °dONLNd;f^qú)cce” on page 2-®†°dONLNdIfùq¢)?5®†°dONLNdJf¢q≠). T„`°dONLNdMf¨qœ)
  6631. ypically`°dONLNdUfœqÁ)#, you °dONLNd[rl}|(zlstor9‡°dONLNd_r}})e your desk accessory driver rm°dONLNd}r})Ñesourµ@°dONLNdÇr}Å)ce in a desk accessory fiİdONLNdõrÇ}Í)ile, which allows you to ˇˇ»å.°dONLNd≥~lâò(Ül
  6632. include a ˇˇë°dONLNdΩ}ôâΩ)-'BNDL'ˇˇ»å°dONLNd√~Ωâ√)$ r¨°dONLNd≈~√â⁄)esour~d°dONLNd ~⁄â’)9ce to give your desk accessory an icon, and the user storÓ»°dONLNd~’â˜)˚es your .°dONLNd älïµ(íldesk accessory fiY†°dONLNdä∂ï€)J
  6633. le in the ƒ`°dONLNd&ä€ïK)%Apple Menu Items folder! °dONLNd=äKïP)p. °dONLNd@úlß(§l"In addition to the driver header fi؆°dONLNdcúßΩ)î-elds important for all drivers, described in ÓİdONLNdêúΩßÕ)Ω“Cr Ä°dONLNdìúÕßÚ)    eating a °dONLNdú®l≥™(∞l
  6634. Driver ResourÒ°dONLNd©®™≥∫)>ce,”™‡°dONLNd≠®ª≥ ) thr†°dONLNd±®À≥›)ee fi#†°dONLNd∂®›≥˙)elds ars`°dONLNdΩ®˙≥ƒ)/e of particular importance to desk accessories:,
  6635.  
  6636. Zapf Dingbats
  6637. °dONLNd̺l√q(¬ln
  6638. .°dONLNdÔ∫x≈ç) The °dONLNdÛπç≈√)    drvrEMask°dONLNd¸∫√≈Õ)6 fi°dONLNdˇ∫Õ≈)
  6639. eld. This fi°dONLNd ∫≈˜)44eld contains an event masks specifying which events .°dONLNd?Δx—´(ŒxCyour desk accessory can handle. If your desk accessory has a windowó`°dONLNdÇΔ™—„(Œ™
  6640. , you should °dONLNdè“x›ø(⁄xinclude keyboar®‡°dONLNdû“ø›fi)G?d, activate, update, and mouse-down events, but you should not °dONLNd›fixÈ·(ÊxNinclude mouse-up events. When an event occurs, the Event Manager checks this fiqİdONLNd,fi‚ÈÚ(Ê‚eld °dONLNd0Íxı(ÚxWto determine whether the desk accessory can handle the type of event, and if so, calls °dONLNdáˆxÏ* the desk accessory’s Contr¿°dONLNd°ˆÌ )uol subrÇ`°dONLNd®ˆ )3outine. See the chapter “The Event Manager” in the °dONLNd€x
  6641. ˆ(
  6642. xInside Macintosh: Macintosh T“İdONLNd¯ı
  6643. )}oolboxãİdONLNd˛
  6644. 2) for morV°dONLNd    3
  6645. ⁄)$%e information about events and event °dONLNd    +xñ(xmasks.
  6646. °dONLNd    2"l)q((ln
  6647. ˇˇ§í.°dONLNd    4 x+å) The ˇˇI$$í°dONLNd    8ç+Ω)drvrMenuˇˇ§í$í°dONLNd    @ Ω+Δ)0 fi…$°dONLNd    C Δ+˘)     eld. This fiH°dONLNd    O ˙+¯)48eld contains the menu ID of your desk accessory’s menu, .°dONLNd    á,x7Q(4x5if it has one, or any one of its menus, if it has mor« °dONLNd    º,Q7)Ÿ&e than one. Otherwise, it contains 0. °dONLNd    ‚8xC‰(@xPThe menu ID for a desk accessory’s menu must be negative and must be distinct frc°dONLNd
  6648. 28‰CÙ(@‰om °dONLNd
  6649. 5DxO%(Lx'the menu ID for other desk accessories.
  6650. °dONLNd
  6651. ]Xl_q(^ln
  6652. .°dONLNd
  6653. _Vxaç) The °dONLNd
  6654. cUça√)    drvrDelay°dONLNd
  6655. lV√aÕ)6 fi°dONLNd
  6656. oVÕa)
  6657. eld and the °dONLNd
  6658. {Ua<)9    dNeedTime°dONLNd
  6659. ÑV<aF)6 fl°dONLNd
  6660. áVFas)
  6661.  
  6662. ag of the °dONLNd
  6663. ëUsa©)-    drvrFlags°dONLNd
  6664. öV©a≥)6 fi°dONLNd
  6665. ùV≥a‚)
  6666.  
  6667. eld. Desk .°dONLNd
  6668. ßbxm(jx$accessories often need to perform pro¿°dONLNd
  6669. Àbm-)†edefi+İdONLNd
  6670. –b.mó)ned actions periodically’‡°dONLNd
  6671. Ëbñmfi)h. For example, a °dONLNd
  6672. ˘nxyÁ(vxSclock desk accessory may want to change the time it displays every second. If your .°dONLNd LzxÖÉ* ;desk accessory needs to perform a periodic action, set the °dONLNd áyÉÖπ(ÇÉ    dNeedTime°dONLNd êzπÖ√)6 fl°dONLNd ìz√Öˆ)
  6673. ag and use .°dONLNd ûÜxëæ(éxthe drvrDelay fi¿°dONLNd ÆÜøëñ)G1eld to indicate how often the action should occurÙ‡°dONLNd flÜïëŒ)÷. The section °dONLNd Ìíxùà(öx“Cr\°dONLNd íàùÎ)eating a Driver Resour!‡°dONLNd íÏù˙)dce”[¿°dONLNd     í˙ùG) describes these fi»`°dONLNd íGùy)M elds in morõ`°dONLNd 'íyùõ)2    e detail.°dONLNd 1§lØê(¨lOf the fiô‡°dONLNd :§êØı)$ve possible driver subrá`°dONLNd Q§ıØ‹)e3outines, your desk accessory needs to implement thrA‡°dONLNd ѧ›ØÎ)Ëee: °dONLNd à∞lª”(∏lOpen, Close, and ContrF‡°dONLNd û∞‘ª·)hol. w °dONLNd ¢∞·ªÁ)
  6674. Y7†°dONLNd £∞Áª¢)(ou can implement a Prime and Status subr†Ä°dONLNd À∞¢ªÏ)ªoutine if needed.ˇp@ˇ ˇˇˇˇ@
  6675. ˇ·ˇ‚7^
  6676. 4H\, Palatino
  6677. .+ä"CHAPTER œ´)\2,     Helvetica
  6678.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äW’ê)riting a Desk ◊`)4    Accessory
  6679. ~¿(‡2
  6680. ‡)-a¿)33
  6681. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6682. 1/91(¯ä Second line.4^H¿
  6683. mHs4nHs nän
  6684. ˇ·ˇ‚7^
  6685. ˇˇ◊ˇ◊°dONLNd]ämU(iäOpening and Closing a Desk d°dONLNd]Umõ)À    Accessoryˇˇˇˇˇˇ•)π2
  6686. °dONLNd%tä&(|ä"In your desk accessory’s Open subr     °dONLNdGt'|)ùoutine, you should:,
  6687.  
  6688. Zapf Dingbats
  6689. °dONLNd[àäèè(éän
  6690. °dONLNd]Üñë°) Cr\°dONLNd_ܰë5)  eate the desk accessory’s windowÓ °dONLNdÜ4ë9)ì. ¿Ä°dONLNdÅÜ9ë?)YŰdONLNdÇÜ?ë)'ou can do this with the Dialog Manager .°dONLNd©íñùΩ(öñ    function ,
  6691. Courier°dONLNd≤ëΩù)' GetNewDialog°dONLNdæíù)H or °dONLNd¬ëùJ)    NewDialog°dONLNdÀíJùP)6. R`°dONLNdÕíPùW)Yg`°dONLNdŒíVù)%ou should specify that the window be °dONLNdÛûñ©˙(¶ñinvisible because the °dONLNd    ù˙©<)d OpenDeskAcc°dONLNdû<©C)B rR`°dONLNdûC©Æ)outine will display it. $¿°dONLNd.ûÆ©µ)kY9¿°dONLNd/û¥©)ou should set the °dONLNdA©ñµ“(≤ñ
  6692. windowKind°dONLNdK™“µŸ)< fPİdONLNdM™Ÿµ<)ield of the window’s PİdONLNdb©<µÑ)c windowRecordPİdONLNdn™ѵ¨)H     data str<İdONLNdw™¨µ¬)(uctur‡°dONLNd|™¬µ)e to the desk .°dONLNdä∂ñ¡Î(æñaccessory’s driver rΩ‡°dONLNdû∂Ρ˚)Ueferj°dONLNd¢∂¸¡5) ence numberÒ‡°dONLNd≠∂4¡Ç)8, which you can fi`°dONLNdø∂É¡„)Ond in the device contr°dONLNd’∂„¡)`ol entry0@°dONLNd›∂¡    )!. ˇˇ±à.°dONLNdfl¬ñÕù( ñYï°dONLNd‡¬úÕÒ)ou should also stor{¯°dONLNdÛ¬ÒÕ†)U&e a copy of the window pointer in the ˇˇcπ¿°dONLNd¡†Õ‹)Ø
  6693. dCtlWindowˇˇ±àπ¿°dONLNd#¬‹ÕÂ)< fikH°dONLNd&¬ÊÕ)
  6694. eld of the .°dONLNd1ŒñŸÃ(÷ñ device contrl`°dONLNd=ŒÃŸÓ)6ol entry熰dONLNdEŒÌŸÔ)!.
  6695. °dONLNdG‚äÈè(Ëän
  6696. °dONLNdI‡ñÎù) ;Allocate private storage as you would for any device driver‡ °dONLNdчúÎû(Ëú.
  6697. °dONLNdÜÙä˚è(˙än
  6698. °dONLNdàÚñ˝°) Cr\°dONLNdäÚ°˝ò) 6eate a menu or menus if needed for your desk accessory–İdONLNd¿Úó˝ú)ˆ. ¢‡°dONLNd¬Úú˝¢)Yc`°dONLNd√Ú¢˝∏)ou ar%°dONLNd»Úπ˝ƒ)e r3†°dONLNdÀÚƒ˝) esponsible for °dONLNd⁄˛ñ    1(ñ adding your menu to the menu bar= °dONLNd˙˛1    ˙)õ,. See the chapter “The Menu Manager” in the , °dONLNd&˛˚    ) Inside °dONLNd-
  6699. ñ˘(ñMacintosh: Macintosh T·°dONLNdC
  6700. ¯)boolboxö°dONLNdI
  6701. Z) volume for morç`°dONLNdX
  6702. ZÄ)H
  6703. e details.°dONLNdcä'Ÿ($äIf your Open subr∫İdONLNdtŸ'í)O,outine is unable to complete its tasks (by rb†°dONLNd†ì'˜)∫unning out of memory™‡°dONLNd¥ˆ'
  6704. )c, for °dONLNd∫(ä3{(0ä3example), you should open only the minimum data str¯‡°dONLNdÌ({3í)Òuctur~¿°dONLNdÚ(ì3)es possible, modify the code °dONLNd4ä?≈(<äso it doesn’t r °dONLNd4Δ?∑)<8espond to events, and display an alert indicating failurM°dONLNdV4∑?æ)Òe.°dONLNdYFäQ(Nä#As for all drivers, your Close subr1‡°dONLNd|F Qˇ)ñ1outine should undo the actions taken by the Open °dONLNd≠Rä]ù(Zäsubr¿°dONLNd±Rû] )Qoutine, disposing of the window and private storage, clearing the window pointer °dONLNd^äi€(fäin the device contrİdONLNd^‹i˛)Rol entry$¿°dONLNd^˝i)!, and rV‡°dONLNd$^iv)emoving the menu frEİdONLNd7^vi¡)]om the menu bar`°dONLNdF^¡i√)K.
  6705. éHî4èHî èäè
  6706. ˇ·ˇ‚7^
  6707. ˇˇ◊ˇ◊°dONLNdH~äé!(ääResponding to Eventsˇˇˇˇˇˇ•(ä2
  6708. °dONLNd]ïä†á(ùä5When the Event Manager determines an event has occurrµ@°dONLNdíïá†)˝ed that your desk accessory ˇˇª∫.°dONLNdưä¨(©äshould handle, it checks the ˇˇwt*¢°dONLNdÀ†¨G)á    drvrEMaskˇˇª∫*¢°dONLNd‘°G¨P)6 fiÊ\°dONLNd◊°P¨)    'eld of the driver header and, if that fiƒ,°dONLNdˇ°¨)¥eld .°dONLNd≠ä∏(µäZindicates your driver handles the event type, it passes the event to your driver by means °dONLNd]πäƒΔ*
  6709. of your Contr≠°dONLNdjπΔƒ‰)<ol subr†°dONLNdqπƒ)outine.ˇˇ@.°dONLNdyÀä÷s(”ä3The Event Manager passes one of nine values in the ˇ˛Ä°dONLNd¨ t÷ò)ÍcsCodeˇˇ@°dONLNd≤Àò÷°)$ fi@°dONLNdµÀ°÷)    eld to indicate the action .°dONLNd–◊ä‚™(fläto take:
  6710.     °dONLNdŸä˙«*
  6711. Constant name¸î°dONLNdÁ«˙Œ)=VˆT°dONLNdËÕ˙fi)alue°dONLNdÌ˙>)MMeaning°dONLNdıå˙é)r 
  6712. .°dONLNd˘˝ä    ∫(äaccEvent.°dONLNd˛Δ    –)<64°dONLNd˛D    ¢)~Handle a given event.°dONLNd    äÆ(äaccRun.°dONLNd!
  6713. Δ–)<65°dONLNd$
  6714. DJ)~T °dONLNd%
  6715. JÆ)ime for periodic action.°dONLNd=ä!¿(ä    accCursor.°dONLNdGΔ!–)<66°dONLNdJD!¡)~Change cursor shape if apprÅ@°dONLNde¡!‡)}opriate.°dONLNdm!ä-¥(*äaccMenu.°dONLNdu"Δ-–)<67°dONLNdx"D-π)~Handle a given menu item.°dONLNdë-ä9¥(6äaccUndo.°dONLNdô.Δ9–)<68°dONLNdú.D9ø)~Handle the Undo command.°dONLNd¥9äEÆ(BäaccCut.°dONLNdª:ΔE–)<70°dONLNdæ:DE∑)~Handle the Cut command.°dONLNd’EäQ¥(NäaccCopy.°dONLNd›FΔQ–)<71°dONLNd‡FDQæ)~Handle the Copy command.°dONLNd¯Qä]¥(ZäaccPast°dONLNdˇR¥]π)*e.°dONLNdRΔ]–)72°dONLNdRD]æ)~Handle the Paste command.°dONLNd]äi∫(fäaccClear.°dONLNd&^Δi–)<73°dONLNd)^Diæ)~Handle the Clear command.°dONLNdBväÅ’(~äAlong with the °dONLNdQu’Å)KaccEvent°dONLNdYvÅ )08 message, the Event Manager sends a pointer to an event °dONLNdëÇäçé(äärR`°dONLNdíÇéç†)ecor$¿°dONLNdñdžç»)    d in the $¿°dONLNdüÅ»çÚ)(csParam$¿°dONLNd¶ÇÚç¸)* fi$¿°dONLNd©Ǹç)
  6716. eld. ˜ °dONLNdÆÇç)Y  °dONLNdØÇç:)ou can rfiİdONLNd∑Ç9çÙ)"'espond to the event in whatever way is .°dONLNdfiéäôû(ñäapprI@°dONLNd‚éüô)Topriate. For example, when your desk accessory becomes active you might install its °dONLNd    6öä•Î(¢ämenu in the menu bar¿@°dONLNd    JöΕ)a. ˇ@ˇ ˇˇˇˇ@
  6717. ˇ·ˇ‚7^
  6718. 4*\˜, Palatino
  6719. .+l"CHAPTER œ´)\2,     Helvetica
  6720.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6721. (‡*2 )-c)34
  6722.     )9    Reference
  6723. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6724. 1/91(¯l Second line.4^*¿¯
  6725. ^*j¯4^*j¯
  6726. °dONLNdˇˇ(elNOTE
  6727. ˇ·ˇ‚7^
  6728. °dONLNdhlsî* AIf your desk accessory’s window is a modeless dialog box and you ˇˇH.°dONLNdAtlv* arR`°dONLNdCtv)
  6729. e calling the Dialog Manager rç.°dONLNdat )åoutine ,
  6730. Courierˇ˛ê,’D°dONLNdhs n)
  6731. IsDialogEventˇˇH’D°dONLNdutn)N in r7–°dONLNdztħ)esponse °dONLNdÇÄlã(àl!to the event, you should set the °dONLNd£ã>)ñ
  6732. windowKind°dONLNd≠Ä>ãH)< fi°dONLNd∞ÄHã§)
  6733. eld of your window ˇˇÑÙ°dONLNd√ålóp(îlrR`°dONLNdƒåpóÇ)ecor$¿°dONLNd»åÇó¥) d to 2 beforÖ¸°dONLNd‘å¥óı)2e you call the ˇˇ    ËôðdONLNd„ãıóC)A
  6734. IsDialogEventˇˇÑÙôðdONLNdåCóI)N rÒ °dONLNdÚåIó£)outine. Setting this .°dONLNdòl£r(†lfiå¿°dONLNd    òr£)'eld to 2 allows the Dialog Manager to rkİdONLNd0ò£ã)¨ecognize and handle the °dONLNdH§lØê(¨levent pr`°dONLNdP§ëØ≠)%operly§°dONLNdV§¨Ø±). v`°dONLNdX§±Ø∑)Y6‡°dONLNdY§∑ØÈ) ou should r†°dONLNdd§ÍØˇ)3estorã °dONLNdi§ˇØr)e the original value of the .°dONLNdÖØlª®(∏l
  6735. windowKind°dONLNdè∞®ªØ)< fPİdONLNdë∞ت‹)
  6736. ield befor"‡°dONLNdõ∞‹ªË)-e rı@°dONLNdû∞Áª) eturning fr«†°dONLNd©∞ªW)0
  6737. om your Contrö°dONLNd∂∞Wªu)@ol subrl`°dONLNdΩ∞uªî)outine.ˇˇ™™°dONLNd≈¬lÕÄ( lThe ˇˇUT*™°dONLNd…¡ÅÕ∑)    accCursorˇˇ™™*™°dONLNd“¬∑Õ¯)6F message makes it possible to change the shape of the cursor when its .°dONLNdŒlŸ (÷lLinside your desk accessory window and your desk accessory window is active. <¿°dONLNddŒÀŸ—(÷ÀY˝@°dONLNdeŒ–Ÿ·)our °dONLNdi⁄lÂÇ(‚lcontr>İdONLNdn⁄ÉÂë)ol r·`°dONLNdr⁄ëÂÒ)Poutine should check whether the mouse location is in your window; if it is, you °dONLNd¬ÊlÒZ(Ól6should set the cursor to the whatever cursor you desir€`°dONLNd¯ÊZÒ’)Óe by calling the QuickDraw .°dONLNdÚl˝p(˙lrR`°dONLNdÚp˝è)outine R`°dONLNdÒè˝À)
  6738. InitCursorï°dONLNd%Ú ˝–);. °dONLNd(l}( l;If your desk accessory window is a dialog box, you should rR`°dONLNdc}æ( }espond to the R`°dONLNdqæÙ)A    accCursorR`°dONLNdzÙ˜)6 .°dONLNd{lÍ(lXmessage by generating a null event (storing the event code for a null event in an event ˇˇYJ.°dONLNd”l'p* rR`°dONLNd‘p'Ç)ecor$¿°dONLNdÿÇ'>))d) and passing it to the Dialog Manager r¡p°dONLNd>'\)ºoutine ˇ˛≤î∫°dONLNd]'•) DialogSelectˇˇYJ∫°dONLNd•'¯)H. This enables the °dONLNd'(l3(0lDialog Manager to blink the carR`°dONLNdF(3)ñet in R`°dONLNdL'3J)editTextR`°dONLNdT(J3l)0 items. °dONLNd]:lE(Bl!When the Event Manager sends the °dONLNd~9E>)®accMenu°dONLNdÖ:>EÅ)* message, it prR`°dONLNdî:ÅEfi)Covides the menu ID °dONLNdßFlQ-(Nl(followed by the menu item number in the °dONLNdœE-QW)¡csParam°dONLNd÷FWQa)* fi°dONLNdŸFaQv)
  6739. eld. R`°dONLNdfiFvQ})Yg`°dONLNdflF|Q÷)ou should take the ˇ˛t9°dONLNdÚRl]Ç(ZlapprR`°dONLNdˆRÇ]W)/opriate action and then call the Menu Manager rΔà°dONLNd%RW]t)’outine ˇ¸Ër:¡°dONLNd,Qu]±)
  6740. HiliteMenuˇ˛t9:¡°dONLNd6R±]¯)< with a value of °dONLNdG^lió(fl
  6741. 0 for the °dONLNdQ]óiª)+menuID°dONLNdW^ªi)$ parameter to rR`°dONLNdf^i|)Femove the highlighting fr$¿°dONLNd^|i»){om the menu barg`°dONLNdé^«i )K.°dONLNdêpl{s(xlYï°dONLNdëpr{•) ou should rg`°dONLNdúp•{)3espond to the last fig`°dONLNd±p{C)] ve messages—g`°dONLNdΩoC{m)AaccUndog`°dONLNdƒpm{)* thr9¿°dONLNd»p{ò)ough 9¿°dONLNdÕoò{»)accClear9¿°dONLNd’p»{‡)0—by .°dONLNdŸ|láu(ÑlprG °dONLNd€|vá¿)
  6742. ocessing the corr4 °dONLNdÏ|¿áΔ)J6esponding editing command in the desk accessory windowÆ@°dONLNd"|≈á“(Ñ≈, if °dONLNd'àlìÄ(êlapprI@°dONLNd+àÅìÓ)Popriate. The chapter “The Scrap Manager” contains information about cutting and °dONLNd{îlüè(úlpasting.°dONLNdѶl±r*Y@İdONLNdÖ¶r±À)our desk accessory r¡†°dONLNdô¶À±)Youtines should rï °dONLNd©¶±()Hestor†°dONLNdƶ)±S)
  6743. e the currÓ†°dONLNd∏¶R±f))ent r°dONLNdΩ¶g±)esourY@°dONLNd¬¶±ê)ce fi‡°dONLNd«¶ë±—)le and the currK`°dONLNd÷¶—±·)@ent .°dONLNd⁄±lΩú(∫lgrafPort°dONLNd‚≤úΩ)0 if it changes either one.
  6744. √*fi¯4√*›¯
  6745. Ô*˜¯4Ô*ˆ¯ Ô*Ô˛
  6746. ˇ·ˇ‚7^
  6747. ˇˇ£‰.ˇÆ°dONLNd˝€*Ìy(È*    Referenceˇˇˇˇˇˇ⁄|(ÈÓ2
  6748. °dONLNdˇl
  6749. -(l+This section describes the Device Manager rˇ†°dONLNd2ˇ-
  6750. ì)¡outines, including the rüİdONLNdJˇî
  6751. Â)goutines that allow °dONLNd] l¶(lFyour application to communicate with existing device drivers and the rņ°dONLNd£ ¶‹(¶
  6752. outines that °dONLNd∞l"u(lprG °dONLNd≤v".)
  6753. (ovide support for your own device driver≈İdONLNd⁄-"Û)∑/. This sections ends with a description of the °dONLNd    #l.|(+l'DRrİdONLNd #|.í)VR' r±Ä°dONLNd#í.™)esour˘¿°dONLNd#™.À)ce type.ˇÚ@ˇ ˇˇˇˇ@
  6754. ˇ·ˇ‚7^
  6755. 4H\, Palatino
  6756. .+ä"CHAPTER œ´)\2,     Helvetica
  6757.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡ä    Reference
  6758. ~¿(‡2
  6759. ‡)-a¿)35
  6760. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6761. 1/91(¯ä Second line.4^H¿
  6762. mHu4nHu nHn
  6763. ˇ·ˇ‚7^
  6764. ˇˇ◊ˇ◊°dONLNd]HmÄ(iHData Strµ°dONLNd]Äm§)8ucturôú°dONLNd
  6765. ]•m≤)%esˇˇˇˇˇˇ•(i2
  6766. óHõ4òHö"òHa
  6767. ˇ·ˇ‚7^
  6768.     °dONLNdˇˇ(ïä Listing 2-10°dONLNdçŒò.)DThe device control entry,
  6769. Courier
  6770. .°dONLNd,§ä∞(≠äTYPE DCtlEntry = °dONLNd>≤äæñ*  °dONLNdD≤úæ¿)RECORD°dONLNdP¿ÆÃ+ dCtlDriver:°dONLNd_¿ˆÃ)H  Ptr;°dONLNdh¿,ÃÏ)6     {pointer or handle to driver°dONLNdí¿ÏÃÚ)¿}°dONLNdôŒÆ⁄Í(◊Æ
  6771. dCtlFlags:°dONLNdߌˆ⁄2)H
  6772.   Integer;°dONLNd¥Œ2⁄h)<       {flags°dONLNd¿Œh⁄n)6}°dONLNd«‹ÆË‰(ÂÆ    dCtlQHdr:°dONLNd‘‹ˆË )H  QHdr;°dONLNdfi‹,ËÏ)6     {driver request queue header°dONLNd‹ÏËÚ)¿}°dONLNdÍÆˆ¸(ÛÆ
  6773. dCtlPosition:°dONLNd Í¸ˆ2)N     LongInt;°dONLNd,Í2ˆû)6   {byte position}°dONLNdD¯Æˆ(Æ dCtlStorage:°dONLNdT¯ˆ,)H      Handle;°dONLNd`¯,‘)6    {handle private storage}°dONLNdÇÆ(Æ dCtlRefNum:°dONLNdëˆ2)H
  6774.   Integer;°dONLNdû2‘)<   {driver reference number°dONLNdæ‘⁄)¢}°dONLNd≈Æ ¸(Æ
  6775. dCtlCurTicks:°dONLNd÷¸ 2)N     LongInt;°dONLNd‚2 §)6   {used internally°dONLNd˚§ ™)r}°dONLNd"Æ.(+Æ dCtlWindow:°dONLNd"ˆ.>)H   WindowPtr;°dONLNd ">.
  6776. )H" {pointer to desk accessory window°dONLNdO"
  6777. .)Ã}°dONLNdV0Æ<Í(9Æ
  6778. dCtlDelay:°dONLNdd0ˆ<2)H
  6779.   Integer;°dONLNdq02<˛)<"   {ticks between periodic actions°dONLNd†0˛<)Ã}°dONLNdß>ÆJÍ(GÆ
  6780. dCtlEMask:°dONLNdµ>ˆJ2)H
  6781.   Integer;°dONLNd¬>2J)<#   {event mask for desk accessories°dONLNdÚ>J
  6782. )“}°dONLNd˘LÆX‰(UÆ    dCtlMenu:°dONLNdLˆX2)H
  6783.   Integer;°dONLNdL2XÚ)<    {menu ID for desk accessories°dONLNd@LÚX¯)¿}°dONLNdBZäfê(cä °dONLNdCZêfñ) °dONLNdDZñfú) °dONLNdIZúf¥)END;
  6784. vHÖ4vHÖ
  6785.     .°dONLNdˇˇ(}äField descriptions
  6786. ˇ·ˇ‚7^
  6787. .°dONLNdNÉäèΔ*
  6788. dCtlDriver.°dONLNdYÑÊè•)\,Contains a pointer or a handle to the driverP¿°dONLNdÖÑ•è)ø, as determined by bit ưdONLNdúÑè)b6 .°dONLNdûêÊõ(òÊof the °dONLNd•èõ;)    dCtlFlags°dONLNdÆê;õE)6 fi°dONLNd±êEõW)
  6789. eld.°dONLNd∂û䙿(ßä    dCtlFlags.°dONLNd¿üÊ™)\
  6790. Contains fl£¿°dONLNdÀü™Ÿ)0/ags about the abilities and state of the driver¡ °dONLNd˙üŸ™)√
  6791. . The low-°dONLNd´Ê∂Ô(≥Êor∫İdONLNd´Ô∂\)    der byte contains these flñ@°dONLNd ´]∂p)nags: 
  6792.     °dONLNd'ªÊ≈Ò(¬ÊBitr!°dONLNd,ªÚ≈) Meaning
  6793. °dONLNd5ΔÊ—Î(ŒÊ5°dONLNd7ΔΗC)Set if driver is open.°dONLNdO“Ê›Î(⁄Ê6°dONLNdQ“Λç)(Set if driver is RAM-based, that is, if .°dONLNd}fiÊÈ˘(ÊÊthe °dONLNdÅ›˘È5)
  6794. dCtlDriver°dONLNdãfi5È?)< fi°dONLNdéfi?ȶ)
  6795. eld contains a handle..°dONLNd¶ÍÊıÎ(ÚÊ7°dONLNd®ÍÎı=)Set if driver is currµ†°dONLNdΩÍ=ıÉ)Rently executing..°dONLNdœ˘Ê(Ê The high-orR`°dONLNd⁄˘v)8der byte contains flR`°dONLNdÓ˘vÖ)XagsR`°dONLNdÚ˘Ö±)
  6796.  copied fr$¿°dONLNd¸˘±‘),om the $¿°dONLNd¯‘
  6797. )#    drvrFlags$¿°dONLNd ˘
  6798. 
  6799. )6 .°dONLNd
  6800. ʘ(
  6801. ÊworİdONLNd¯>)d of the driver rÚ@°dONLNd!=U)Eesour:İdONLNd&Vu)ce. See «`°dONLNd.uÖ)“Cr£`°dONLNd1ÖË)eating a Driver Resouri@°dONLNdGÈ)dce” on °dONLNdNÊ(Êpage 2-Æ¿°dONLNdU ) 5Æ¿°dONLNdV .) for mory@°dONLNd^/m)$e information..°dONLNdmä+∫((ädCtlQHdr.°dONLNdv Ê+~)\#Contains the header of the driver r,`°dONLNdô +Ì)ôequest queue, which is a °dONLNd≤,Ê7(4Êstandar±Ä°dONLNdπ,7¸)!5d Operating System queue. See the chapter “Operating °dONLNdÓ8ÊCN(@ÊSystem Utilities” in the ˜ °dONLNd8NC‚)h"Inside Macintosh: Operating Systems†°dONLNd)8„C    )ï volume .°dONLNd1DÊO(LÊfor morR`°dONLNd8DOw)!e information about the R`°dONLNdPCwOè)pQHdrR`°dONLNdTDèO√)  data type.°dONLNd`Rä^Ã([ä dCtlPostion.°dONLNdlSÊ^3)\Indicates the curry†°dONLNd~S3^W)Ment sourU†°dONLNdÜSW^‹)$ ce or destination position for ró`°dONLNd¶S‹^)Ö
  6802. eading or °dONLNd∞_Êj'(gÊwriting. This fi·Ä°dONLNd¿_'j˝)A2eld is only used by drivers of block devices. The °dONLNdÚkÊv$(sÊvalue in this fi_°dONLNdk%vı)?/eld is the number of bytes beyond the physical °dONLNd1wÊÇÏ(Ê9beginning of the medium used by the device. For example, °dONLNdjÉÊéÅ* #immediately after the Disk Driver rC°dONLNdçÉÇéØ)ú
  6803. eads the fiOİdONLNdòÉØéˇ)-rst block of data frÊ¿°dONLNd¨Éˇé)Pom °dONLNdØèÊöC(óÊa 3.5-inch disk, this fiÂ`°dONLNd«èCö¥)]eld contains the value 512‡ °dONLNd·èµö∑)r.ˇ@ˇ ˇˇˇˇ@
  6804. ˇ·ˇ‚7^
  6805. 4*\˜, Palatino
  6806. .+l"CHAPTER œ´)\2,     Helvetica
  6807.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6808. (‡*2 )-c)36
  6809.     )9    Reference
  6810. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6811. 1/91(¯l Second line.4^*¿¯,
  6812. Courier
  6813. .°dONLNd\lhÆ(el dCtlStorage.°dONLNd ]»hH)\Contains a handle to a driver÷°dONLNd)]Ihô)Å’s private storage. KİdONLNd=]öh°)QAÜ °dONLNd>]°h◊)  driver may °dONLNdJi»t˜(q» allocate a rİdONLNdVi¯tÊ)06elocatable block of memory and keep a handle to it in °dONLNdåu»Ä‡(}»this fiE‡°dONLNdìu·ÄÒ)eld..°dONLNdòÉlè®(ål
  6814. dCtlRefNum.°dONLNd£Ñ»è$)\Contains the driver r톰dONLNd∏Ñ$è4)\efer>¿°dONLNdºÑ5èn) ence numberΔ†°dONLNd«Ñmèo)8..°dONLNd…ílû¥(õl dCtlCurTicks.°dONLNd÷ì»û )\Used internally∑İdONLNdÂì û
  6815. )C..°dONLNdÁ°l≠®(™l
  6816. dCtlWindow.°dONLNdÚ¢»≠†)\/Contains a pointer to the desk accessory window7 °dONLNd!¢†≠¢)ÿ.∑ °dONLNd"¢¢≠µ) See ä °dONLNd'¢∂≠“)“Refer‰@°dONLNd-¢“≠Ì)ence” °dONLNd3Æ»πı(∂»
  6817. on page 2-u†°dONLNd=ƈπ).34u†°dONLNd?Æπ#)
  6818.  for mor@ °dONLNdGÆ$π`)$
  6819. e informationE °dONLNdTÆ`πb)<..°dONLNdVºl»¢(≈l    dCtlDelay.°dONLNd`Ω»»Ÿ)\>Indicates the number of ticks to wait between periodic actions#‡°dONLNdûΩ⁄»‹(≈⁄..°dONLNd†Àl◊¢(‘l    dCtlEMask.°dONLNd™Ã»◊è)\,Contains the desk accessory event mask. See ņ°dONLNd÷Ãè◊´)«“Refer€¿°dONLNd‹Ã´◊Î)ence” on page °dONLNdÍÿ»„–(‡»2-”‡°dONLNdÏÿ–„⁄)34”‡°dONLNdÓÿ⁄„˝)
  6820.  for morû`°dONLNdˆÿ˛„:)$
  6821. e information£`°dONLNdÿ:„<)<..°dONLNdÊlÚú(ÔldCtlMenu.°dONLNdÁ»Ú¡)\7Contains the menu ID of a desk accessory’s menu, if anyó‡°dONLNdEÁ¿Ú¬)¯.‡°dONLNdFÁ√Ú÷) See °dONLNdKÛ»˛‰(˚»“Refer⁄ °dONLNdQÛ‰˛-)ence” on page 2-$†°dONLNdaÛ.˛8)J34$†°dONLNdcÛ8˛[)
  6822.  for morÔ °dONLNdkÛ[˛ó)#
  6823. e informationÙ °dONLNdxÛó˛ô)<.
  6824. *#¯4*#¯ l¯
  6825. ˇ·ˇ‚7^
  6826. °dONLNdzl˛(lThe Extended Device Contr˝Ä°dONLNdì˛()íol Entryˇˇˇˇˇˇ)Ù2
  6827. °dONLNdú*l5µ(2lThe device contr® °dONLNd¨*µ5¶)I:ol entry for drivers that serve slot devices needs to storm‡°dONLNdÊ*ß5»)Úe some °dONLNdÌ6lA(>l'additional information: the slot number"‡°dONLNd6AF)Ø , the slot r¢Ä°dONLNd 6FA^)+esourÍ¿°dONLNd%6^A‘)ce ID, the device base addrV`°dONLNd@6’AÁ)wess, ˇˇ©œ.°dONLNdEBlMd(Jl5and the external device ID. The extended device contr†ÿ°dONLNdzBdMá)¯ol entry.Á°dONLNdÇBáMû)#, defiÿ∂°dONLNdàBûM–) ned by the ˇˇSû÷#°dONLNdìA—Mı)3AuxDCEˇˇ©œ÷#°dONLNdôBıM˜)$ .°dONLNdöNlY£(Vl
  6828. data type in µ °dONLNdßN£Y)7“The extended device contr.°dONLNd¡NYt)zol entry” on page 2-‡†°dONLNd’NtY~)W35‡†°dONLNd◊N~Y‡)
  6829. , contains additional fiWİdONLNdÔN·Yı)celds °dONLNdÙZleà(blto storq¿°dONLNd˚Zàe«)e these values.
  6830. á*ã¯4à*ä¯"à*a
  6831. ˇ·ˇ‚7^
  6832.     °dONLNdˇˇ(Öl Listing 2-11°dONLNd }∞à7)D!The extended device control entry
  6833. .°dONLNd-îl†∫(ùl
  6834. TYPE AuxDCE= °dONLNd;¢lÆx*  °dONLNd=¢xÆ~)  °dONLNd>¢~Æ¢)RECORD°dONLNdJ∞꺓+ dCtlDriver:°dONLNdY∞ÿº¸)H  Ptr;°dONLNdb∞ºŒ)6     {pointer or handle to driver°dONLNdå∞Œº‘)¿}°dONLNdìæê Ã(«ê
  6835. dCtlFlags:°dONLNd°æÿ )H
  6836.   Integer;°dONLNdÆæ J)<       {flags°dONLNd∫æJ P)6}°dONLNd¡ÃêÿΔ(’ê    dCtlQHdr:°dONLNdŒÃÿÿ)H  QHdr;°dONLNdÿÃÿŒ)6     {driver request queue header°dONLNdÃŒÿ‘)¿}°dONLNd    ⁄êÊfi(„ê
  6837. dCtlPosition:°dONLNd⁄fiÊ)N     LongInt;°dONLNd&⁄ÊÄ)6   {byte position}°dONLNd>ËêÙÿ(Òê dCtlStorage:°dONLNdNËÿÙ)H      Handle;°dONLNdZËÙ∂)6    {handle private storage}°dONLNd|ˆê“(ˇê dCtlRefNum:°dONLNdãˆÿ)H
  6838.   Integer;°dONLNdòˆ∂)<   {driver reference number°dONLNd∏ˆ∂º)¢}°dONLNdøêfi(
  6839. ê
  6840. dCtlCurTicks:°dONLNd–fi)N     LongInt;°dONLNd‹Ü)6   {used internally°dONLNdıÜå)r}°dONLNd¸ê“(ê dCtlWindow:°dONLNd ÿ )H   WindowPtr;°dONLNd Ï)H" {pointer to desk accessory window°dONLNdIÏÚ)Ã}°dONLNdP ê,Ã()ê
  6841. dCtlDelay:°dONLNd^ ÿ,)H
  6842.   Integer;°dONLNdk ,‡)<"   {ticks between periodic actions°dONLNdö ‡,Ê)Ã}°dONLNd°.ê:Ã(7ê
  6843. dCtlEMask:°dONLNdØ.ÿ:)H
  6844.   Integer;°dONLNdº.:Ê)<#   {event mask for desk accessories°dONLNdÏ.Ê:Ï)“}°dONLNdÛ<êHΔ(Eê    dCtlMenu:°dONLNd<ÿH)H
  6845.   Integer;°dONLNd
  6846. <H‘)<    {menu ID for desk accessories°dONLNd:<‘H⁄)¿}°dONLNdAJêVΔ(Sê    dCtlSlot:°dONLNdNJÿV)H
  6847.   Integer;°dONLNd\J VD)H {slot°dONLNddJDVJ)$}°dONLNdkXêdÃ(aê
  6848. dCtlSlotId°dONLNdyXÿd)H
  6849.   Integer;°dONLNdáX dV)H     {slot ID°dONLNdìXVd\)6}°dONLNdöfêrfi(oê
  6850. dCtlDevVBase:°dONLNd´ffir)N     Integer;°dONLNd∏f rÊ)B! {base address of card for driver°dONLNdÊfÊrÏ)Δ}°dONLNdÌtêÄΔ(}ê    reserved:°dONLNd˙tÿÄ)H
  6851.   Integer;°dONLNdt Ä™)H {reserved; should be 0°dONLNd&t™Ä∞)ä}°dONLNd-Çêé“(ãê dCtlExtDev:°dONLNd<Çÿé)H
  6852.   Integer;°dONLNdJÇ éò)H {external device ID°dONLNddÇòéû)x}°dONLNdkêêúΔ(ôê    fillByte:°dONLNdxêÿú)H
  6853.   Integer;°dONLNdÜê ú\)H
  6854.  {reserved°dONLNdìê\úb)<}°dONLNdïûl™r(ßl °dONLNdñûr™x) °dONLNdóûx™ñ) END;ˇ‰@ˇ ˇˇˇˇ@
  6855. ˇ·ˇ‚7^
  6856. 4H\, Palatino
  6857. .+ä"CHAPTER œ´)\2,     Helvetica
  6858.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡ä    Reference
  6859. ~¿(‡2
  6860. ‡)-a¿)37
  6861. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6862. 1/91(¯ä Second line.4^H¿
  6863. °dONLNd]äh£(eäThe fi»Ä°dONLNd]£h÷) rst eleven fi °dONLNd]◊hh)4!elds of the extended device contrr¿°dONLNd4]hhï)ë ol entry arÙ¿°dONLNd?]ïhÊ)-e identical to the fiLJ°dONLNdT]Áh)Relds of °dONLNd\iät–(qäthe device contr…¿°dONLNdli–tÚ)Fol entryΰdONLNdtiÒtH)!, described in the pr£‡°dONLNdâiItâ)Xevious section.
  6864. ÅHë4ÇHê
  6865.     °dONLNdˇˇ(âäField descriptions
  6866. ˇ·ˇ‚7^,
  6867. Courier
  6868. .°dONLNdôéäö∫*dCtlSlot.°dONLNd¢èÊöU)\Contains the slot numberц°dONLNd∫èUöZ)o. .°dONLNdΩùä©Δ(¶ä
  6869. dCtlSlotId.°dONLNd»ûÊ©/)\Contains the Rsr§`°dONLNdÿû/©Ö)IcDirID for the slot r@°dONLNdÌûÜ©û)WesourLİdONLNdÚûû©©)ce..°dONLNdˆ¨ä∏Ã(µä dCtlDevBase.°dONLNd≠Ê∏j)\Points to the device base addrÜ °dONLNd ≠j∏y)Ñess..°dONLNd%ªä«Δ(ƒä
  6870. dCtlExtDev.°dONLNd0ºÊ«s)\ Contains the external device ID.°dONLNdQŒäŸ (÷äVThe chapter “The Slot Manager” in this book contains detailed information about these °dONLNdß⁄ä´* values. 
  6871. H4H H
  6872. ˇ·ˇ‚7^
  6873. ˇˇ◊ˇ◊°dONLNd∞HÖ(HRoutinesˇˇˇˇˇˇ•(2
  6874. °dONLNdπä*Ú('äThe Device Manager prd@°dONLNdŒÚ*M)hovides a number of r    Ä°dONLNd‚N*é)\outines that pr¶ °dONLNdÒé*    )@ovide low-level support for °dONLNd
  6875. +ä6È(3äyour own driver subrÜ@°dONLNd!+È6 )_outines.ˇˇ:.°dONLNd*=äHû(EäThe ˇ˛t6∫°dONLNd.<ûHÊ) GetDCtlEntryˇˇ:∫°dONLNd:=ÊH
  6876. )HC function allows your driver to obtain a handle to its device contrEø°dONLNd}= H(E ol .°dONLNdÄIäT°(Qäentry√`°dONLNdÖI†T•). ˇˇéú.°dONLNdà[äfû(cäThe ˇˇ8ú°dONLNdåZüf√)IODoneˇˇéúú°dONLNdí[√f…)$ roò°dONLNdî[…fÌ)?outine allows your driver to notify the Device Manager that a rb¨°dONLNd”[Ìf(cÌ
  6877. equest is ˇˇÔ—°dONLNd›gärÕ(oäcomplete. The ˇˇfl¢_¢°dONLNdÎfŒrÏ)DFetchˇˇÔ—_¢°dONLNdgÏr) and ˇˇfl¢?D°dONLNdıfr!)StashˇˇÔ—?D°dONLNd˙g!r') ru°dONLNd¸g(r)3outines allow your driver move characters into and .°dONLNd/sä~À({äout of data bufõİdONLNd>sÀ~‡)Afers. ª°dONLNdDs‡~Ê)Y{İdONLNdEsÊ~Ö)%ou pass a pointer to the device contr%‡°dONLNdjsÜ~Δ)†ol entry in the †°dONLNdzsΔ~Ÿ)@A1 r'‡°dONLNd~sŸ~) egister to °dONLNdâää“(áäeach of these thrë`°dONLNdö“ä‚)Hee ri†°dONLNdû‚ä¡)1outines. The Device Manager uses the device contr†°dONLNdœ¬ä)‡ol entry to locate °dONLNd‚ãäñ∫(ìä the active r-@°dONLNdÓãªñ)1equest. If no such r§ °dONLNdãñh)Sequest exists, these ró°dONLNdãhñÂ)Zoutines generates system err0 °dONLNd4ãÊñÒ)~or .°dONLNd7ñä¢Ã(üä dsIOCoreErr¬†°dONLNdBóÀ¢Œ)A.ˇˇ82°dONLNdD©ä¥Ω(±ä In the inter¬ƒ°dONLNdP©Ω¥<)3est of speed, you invoke the ˇ˛pd°dONLNdm®=¥[)ÄFetchˇˇ82°dONLNdr©[¥`), ˇ˛pdL"°dONLNdt®`¥~)Stashˇˇ82L"°dONLNdy©~¥ñ), and ˇ˛pdºÜ°dONLNd®ñ¥∫)IODoneˇˇ82ºÜ°dONLNdÖ©∫¥¿)$ r«°dONLNdá©¿¥˚)
  6878. outines with ˇˇY.7|°dONLNd¥)<jump °dONLNdôµä¿™(Ωävectors.∂@°dONLNd†µ™¿¡) , storà†°dONLNd¶µ¡¿=)ed in the global variables à†°dONLNd¡¥=¿a)|JFetchà†°dONLNd«µa¿g)$, à†°dONLNd…¥g¿ã)JStashà†°dONLNdœµã¿•)$, and à†°dONLNd’¥•¿œ)JIODoneà†°dONLNd‹µœ¿)*, rather than .°dONLNdÍ¡äÆ(…ämacrâ@°dONLNdÓ¡†ÃÆ)os.  °dONLNdÚ¡Øõ)YŒ†°dONLNdÛ¡¥Ãg)'ou use a jump vector by moving its addrÀ@°dONLNd¡gÃπ)≥ess onto the stack. ã`°dONLNd.¡πÃ˙)RAn example is:.°dONLNd=ÿ䉯(·äMOVE.L°dONLNdIÿ¿‰)6
  6879. JIODone,-(SP)°dONLNdWÊäÚú(ÔäRTSˇˇV°dONLNd[ˇä
  6880. û*The ˇ˛¨
  6881. ÷°dONLNd_˛û
  6882. º)FetchˇˇV÷°dONLNddˇº
  6883. —) and ˇ˛¨
  6884. ǰdONLNdi˛“
  6885. )StashˇˇVǰdONLNdnˇ
  6886. ˆ) r™t°dONLNdpˇˆ
  6887. :)outines do not r~„°dONLNdġ:
  6888. _)D    eturn a r˝M°dONLNdâˇ_
  6889. µ)%esult code; if an err'¡°dONLNdûˇ∂
  6890. )Wor occurs, the System .°dONLNd¥ äò(äErrS`°dONLNd∑ ò˛)or Handler is invoked. 
  6891. SH[4SHZ SHS
  6892. ˇ·ˇ‚7^
  6893. °dONLNd–EHRî(OH GetDCtlEntryˇˇˇˇˇˇ(O2
  6894. ˇˇ¨N.°dONLNd›eäpë(mäYï°dONLNdfieêp—)ou can use the ˇˇXúF8°dONLNdÌd“p)B GetDCtlEntryˇˇ¨NF8°dONLNd˘ep)H0 function to obtain a handle to the device contr'V°dONLNd)ep)÷    ol entry .°dONLNd2qä|◊(yäof a device driver °dONLNdDq◊|Ÿ)M..°dONLNdFàäî(ëäFUNCTION GetDCtrlEntry °dONLNdgàîŒ)ä(refNum: Integer) : DCtlHandle;°dONLNdá†ä¨Æ(©ärefNum.°dONLNdé°“¨)HContains the rπ`°dONLNdú°¨ )>efereİdONLNd†°!¨ì)ence number of the driverm`°dONLNdπ°ì¨ï)r.ˇæ@ˇ ˇˇˇˇ@
  6895. ˇ·ˇ‚7^
  6896. 4*\˜, Palatino
  6897. .+l"CHAPTER œ´)\2,     Helvetica
  6898.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6899. (‡*2 )-c)38
  6900.     )9    Reference
  6901. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6902. 1/91(¯l Second line.4^*¿¯
  6903. °dONLNd]*ec(c* DESCRIPTION
  6904. ˇˇÜÉ.°dONLNd olzÄ+BThe ,
  6905. Courierˇˇ
  6906. ɰdONLNdnÅz…) GetDCtlEntryˇˇÜÉɰdONLNdo…zˆ)H  function rÂȰdONLNd'oızì),#eturns a handle to the device contrfl[°dONLNdJoìz˜)ûol entry of the device .°dONLNda{lÜ◊(Éldriver indicated by the rË@°dONLNdz{◊Ü&)kefNum parameterÉ`°dONLNdâ{&Ü()O.
  6907. ∂*æ¯4∑*毠∑*∑˛
  6908. ˇ·ˇ‚7^
  6909. °dONLNdå©*∂G(≥*Fetchˇˇˇˇˇˇ(≥Ú2
  6910. .°dONLNdí…l‘s(—lYï°dONLNdì…r‘µ)ou can use the ï°dONLNd¢»µ‘”)CFetchï°dONLNdß…”‘⁄) rg`°dONLNd©…⁄‘v)#outine to get the next character fr9¿°dONLNdÃ…v‘¿)úom the data buf  °dONLNd€…¿‘Õ)JferN¿°dONLNdfi…Ñœ) .
  6911. .°dONLNd‡Ô*˜c(ı* DESCRIPTION
  6912. .°dONLNdÏl Å+BThe °dONLNdÅ ü)Fetch°dONLNdıü ¶) rR`°dONLNd˜¶ :)!outine gets the next character fr$¿°dONLNd: Ñ)îom the data buf˜ °dONLNd'É Ê)Ifer pointed to by the °dONLNd= lú(lioBuffer°dONLNdE
  6913. ú£)0 fPİdONLNdG
  6914. £p),ield of the parameter block of the pending r"‡°dONLNds
  6915. pÆ)Õequest. It incrı@°dONLNdÇ
  6916. ≠‚)= ements the ˇˇ«$°dONLNdçl$®(!l
  6917. ioActCountˇˇ„í°dONLNdó®$Æ)< f4°dONLNdôØ$˚)ield by 1. If the ˇˇ«$•ϰdONLNd´˚$7)L
  6918. ioActCountˇˇ„í•ϰdONLNdµ7$=)< fY˛°dONLNd∑>$Ü)ield equals the ˇˇ«$¥°dONLNd«á$√)I
  6919. ioReqCountˇˇ„í¥°dONLNd—√$…)< f∏Δ°dONLNd”…$˜) ield, this .°dONLNdfi%l0–(-lfunction sets bit 15 of r’°dONLNd˜%–0)d egister D0. 0†°dONLNd%0)2After rè`°dONLNd
  6920. %0Ç)eceiving the last byte ró@°dONLNd"%Ç0Ú)cequest, the driver should °dONLNd<1l<∑(9lcall the IODone rÎİdONLNdM1∑<’)Koutine.
  6921.     °dONLNdU@lK∫(HlRegisters on entry
  6922. °dONLNdhOlZx*A1°dONLNdkO®Z)<pointer to the device contr±†°dONLNdÜOZ>)tol entry
  6923.     °dONLNdè^li¥(flRegisters on exit
  6924. °dONLNd°mlxx*D0°dONLNd§m®x≥)<Ccharacter fetched; bit 15 = 1 if it’s the last character in the buf @°dONLNdÁm¥x¿(u¥fer
  6925.     °dONLNdÎ|lá°(Ñl Jump vector
  6926. °dONLNd¯ãlñá*JFetch
  6927. ÷*fi¯4◊*fi¯ ◊*◊˛
  6928. ˇ·ˇ‚7^
  6929. °dONLNd…*÷G(”*Stashˇˇˇˇˇˇ(”Ú2
  6930. .°dONLNd    ÈlÙs(ÒlYï°dONLNd
  6931. ÈrÙµ)ou can use the ï°dONLNd˵Ù”)CStashï°dONLNdÈ”Ù⁄) rg`°dONLNd È⁄Ù)outine to stor9¿°dONLNd.ÈÙ~)<e the next character fr  °dONLNdEÈ~Ù»)hom the data buffiİdONLNdTȫّ)Ifer! °dONLNdWÈ‘Ù◊)
  6932. .
  6933. .°dONLNdY*c(* DESCRIPTION
  6934. ˇˇå.°dONLNde!l,Ä+BThe ˇ˛àå°dONLNdi Ä,û)Stashˇˇåàå°dONLNdn!û,§) rcx°dONLNdp!§,0) outine places the character in r`î°dONLNdê!0,¨)åegister D0 into the data buf]∞°dONLNd¨!¨,¯)|fer pointed to by ˇˇœ©°dONLNdæ-l8~(5lthe ˇˇüRO©°dONLNd¬,8Ø)ioBufferˇˇœ©O©°dONLNd -Ø8∏)0 fiR°dONLNdÕ-π8Ä)
  6935. +eld of the parameter block of the pending rn˙°dONLNd¯-Ä8√)«equest and incr‡¨°dONLNd-√8˜)C ements the ˇˇ«$°dONLNd8lD®(Al
  6936. ioActCountˇˇ„í°dONLNd9®DÆ)< f4°dONLNd9ØD˚)ield by 1. If the ˇˇ«$•ϰdONLNd08˚D7)L
  6937. ioActCountˇˇ„í•ϰdONLNd:97D=)< fY˛°dONLNd<9>DÜ)ield equals the ˇˇ«$¥°dONLNdL8áD√)I
  6938. ioReqCountˇˇ„í¥°dONLNdV9√D…)< f∏Δ°dONLNdX9…D˜) ield, this .°dONLNdcElP–(Mlfunction sets bit 15 of r’°dONLNd|E–P)d egister D0. 0†°dONLNdàEP~)2After stashing the last byte rÕ‡°dONLNd¶E~Pÿ)|equested, the driver .°dONLNdªQl\∂(Ylshould call the °dONLNdÀP∂\⁄)JIODone°dONLNd—Q⁄\·)$ rR`°dONLNd”Q·\)outine.
  6939. .°dONLNd€w*P(}*ASSEMBL‹è°dONLNd‚wPT)&Yö∫°dONLNd„wU≤)-LANGUAGE INFORMA—U°dONLNdÙw≤«)]TION
  6940.     °dONLNd˘âlî∫(ëlRegisters on entry
  6941. °dONLNd òl£x*A1°dONLNdò®£Í)<pointer to DCE°dONLNd®l≥x(∞lD0°dONLNd!®®≥Ù)<character to stashˇ∞@ˇ ˇˇˇˇ@
  6942. ˇ·ˇ‚7^
  6943. 4H\, Palatino
  6944. .+ä"CHAPTER œ´)\2,     Helvetica
  6945.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡ä    Reference
  6946. ~¿(‡2
  6947. ‡)-a¿)39
  6948. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6949. 1/91(¯ä Second line.4^H¿
  6950.     °dONLNd\äg“(däRegisters on exit
  6951. °dONLNdkävñ*D0°dONLNdkΔvÅ)<0bit 15 = 1 if it’s the last character in the bufa@°dONLNdEkÅvç)ªfer
  6952.     °dONLNdIzäÖø(Çä Jump vector
  6953. °dONLNdVâäî§*JStash
  6954. ”H€4‘H€ ‘H‘
  6955. ˇ·ˇ‚7^
  6956. °dONLNd^ΔH”t(–HIODoneˇˇˇˇˇˇ(–2
  6957. ˇˇ‘Ü.°dONLNdeÊäÒë(ÓäYï°dONLNdfÊêÒ“)ou can use the ,
  6958. Courierˇˇ© Á°dONLNdu“҈)BIODoneˇˇ‘ÜÁ°dONLNd{ʈҸ)$ r粰dONLNd}Ê˝Ò‚)1outine to notify the Device Manager that the curré°dONLNdÆÊ„Ò˜)Êent r´t°dONLNd≥ʘÒ)equest .°dONLNd∫Úä˝Ã(˙ähas been satisfi, °dONLNd ÚÕ˝⁄)Ced.
  6959. °dONLNdŒH Å(H DESCRIPTION
  6960. .°dONLNd⁄*ä5ü+BThe °dONLNdfi)ü5√)IODone°dONLNd‰*√5 )$ rR`°dONLNdÊ* 5Ì)outine r$¿°dONLNdÓ*Ì55)#emoves the curr˜ °dONLNd˝*45I)Gent r…İdONLNd*I5p)    equest frõ‡°dONLNd *p5∑)'om the driver rn@°dONLNd*∑5)Gequest queue, marks .°dONLNd.6äAâ(>ä<the driver inactive, unlocks the driver and its device contr‡°dONLNdj6âA˝)ˇol entry (if allowed by the °dONLNdÜBäM((Jä"dNeedLock bit of the dCtlFlags wor6°dONLNd®B)Mª)ü!d), and executes the completion rꇰdONLNd…BªMÚ)í
  6961. outine if anyT@°dONLNd÷BÚM)7. Then °dONLNd›NäY.(Vä$the Device Manager begins the next ræ@°dONLNdN.Yä)§equest in the driver r&İdONLNdNãY«)]
  6962. equest queue.°dONLNd%]ähæ(eä The section ,Times$@°dONLNd1\øhÇ)5-“Responding to the Device Manager” on page 2-V‡°dONLNd^\Çhá)√9V‡°dONLNd_]áh)  explains in detail when to use °dONLNdiät†(qäthis r˛ °dONLNdÖi†tæ)outine.
  6963. °dONLNdçèHón(ïHASSEMBL‹è°dONLNdîènór)&Yö∫°dONLNdïèsó–)-LANGUAGE INFORMA—U°dONLNd¶è–óÂ)]TION
  6964.     °dONLNd´°ä¨ÿ(©äRegisters on entry
  6965. °dONLNdæ∞äªñ*A1°dONLNd¡∞Δª )< pointer to DCE°dONLNd—¿äÀñ(»äD0°dONLNd‘¿ΔÀÃ)< r≈°dONLNd÷¿ÃÀ¯)
  6966. esult code
  6967.     °dONLNd·œä⁄ø(◊ä Jump vector
  6968. .°dONLNdÓ›äÈ¥*JIODone
  6969. .°dONLNd˜H o(
  6970. HSEE ALSO
  6971. °dONLNdä+BFor an example of the IODone r6‡°dONLNdG)å outine, see …İdONLNd*G)1+“Responding to the Device Manager” on page °dONLNdUä)í(&ä2-”‡°dONLNdWí)ó)9”‡°dONLNdXó)ô).
  6972. UH]4VH] VHV
  6973. ˇ·ˇ‚7^
  6974. ˇˇ◊ˇ◊°dONLNdZEHUx(QHResour'°dONLNd`EyUç)1cesˇˇˇˇˇˇ•(Q2
  6975. °dONLNddbäm(jä#This section describes the driver r˜Ä°dONLNdábm6)îesour?¿°dONLNdåb7m≈) ce, which you should use to storf`°dONLNd¨b≈m)ée your device °dONLNd∫näy (vädrivers and desk accessories. ∞ °dONLNdÿn y?)Ç Listing 2-12P`°dONLNd‰n@y–)4  shows the Rez format of the 'DR®‡°dONLNdn–yÊ)êVR' rÁ‡°dONLNd    nÊy˛)esour0 °dONLNdnˇy
  6976. )ce .°dONLNdzäÖfi(Çätype. The driver rR`°dONLNd#zfiÖı)Tesour$¿°dONLNd(zıÖ-) ce has type $¿°dONLNd4y-ÖQ)8'DRVR'$¿°dONLNd:zQÖT)$.ˇÏ@ˇ ˇˇˇˇ@
  6977. ˇ·ˇ‚7^
  6978. 4*\˜, Palatino
  6979. .+l"CHAPTER œ´)\2,     Helvetica
  6980.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  6981. (‡*2 )-c)40
  6982.     )9    Reference
  6983. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  6984. 1/91(¯l Second line.4^*¿¯
  6985. g*j¯4g*j¯"g*a
  6986. ˇ·ˇ‚7^
  6987.     °dONLNdˇˇ(dl Listing 2-12°dONLNd\∞g¡)D 'DRçê°dONLNd\¡g)VR' resource format,
  6988. Courier
  6989. .°dONLNds*x(|*
  6990. type 'DRVR' {°dONLNd'Å6ç~+  boolean = 0;°dONLNd5è6õ`*boolean°dONLNd?èlõˆ)6dontNeedLock, needLock;°dONLNd`è õ∂)¥/* lock drvr in memory */°dONLNd{ù6©`(¶6boolean°dONLNdÖùl©ˆ)6dontNeedTime, needTime;°dONLNd¶ù ©∂)¥/* for periodic action */°dONLNd¡´6∑`(¥6boolean°dONLNdÀ´l∑)6dontNeedGoodbye, needGoodbye;°dONLNdÚ´ ∑Œ)¥/* call before heap reinit */°dONLNdπ6≈`(¬6boolean°dONLNdπl≈)6noStatusEnable, statusEnable;°dONLNdBπ ≈∞)¥/* responds to Status */°dONLNd\«6”`(–6boolean°dONLNdf«l”ˆ)6noCtlEnable, ctlEnable;°dONLNdá« ”∂)¥/* responds to Control */°dONLNd¢’6·`(fi6boolean°dONLNd¨’l·)6noWriteEnable, writeEnable;°dONLNd—’ ·™)¥/* responds to Write */°dONLNdÍ„6Ô`(Ï6boolean°dONLNdÙ„lÔ)6noReadEnable, readEnable;°dONLNd„ Ô§)¥/* responds to Read */°dONLNd/Ò6˝l(˙6    byte = 0;°dONLNd:ˇ6 f*integer;°dONLNdOˇ  å)Í/* driver delay */°dONLNdc
  6991. 6¥(6unsigned hex integer;°dONLNdÖ
  6992.  í)Í/* DA event mask */°dONLNdö6'f($6integer;°dONLNdØ 'n)Í
  6993. /* DA menu */°dONLNdæ)65¥(26unsigned hex integer;°dONLNd‡) 5ò)Í/* offset to Open */°dONLNdˆ76C¥(@6unsigned hex integer;°dONLNd7 Cû)Í/* offset to Prime */°dONLNd/E6Q¥(N6unsigned hex integer;°dONLNdQE Q§)Í/* offset to Control*/°dONLNdiS6_¥(\6unsigned hex integer;°dONLNdãS _§)Í/* offset to Status */°dONLNd£a6m¥(j6unsigned hex integer;°dONLNd≈a mû)Í/* offset to Close */°dONLNd‹o6{l(x6    pstring; °dONLNdÚo {Ü)Í/* driver name */°dONLNd}6âx(Ü6 hex string;°dONLNd} âÜ)Í/* driver code */°dONLNd/ã*ó6(î*};.°dONLNd2§lذ+B The driver rZ°dONLNd>§°Øπ)5esour¢@°dONLNdC§πØ)ce begins with seven fl[°dONLNdZ§Ø·)d0ags that specify certain characteristics of the °dONLNdä∞lªá(∏ldriver‡°dONLNdê∞áªå). ˇˇ‰î.°dONLNdì¬lÕs( lYï°dONLNdî¬rÕ≈)ou need to set the ˇˇ…( ‰°dONLNdß¡ΔÕ¸)T    dNeedLockˇˇ‰î ‰°dONLNd∞¬¸Õ)6 flx°dONLNd≥¬ÕQ)    ag if your driver[î°dONLNdƒ¬SÕÛ)N"’s code should be locked in memoryõL°dONLNdʬÚÕ˜)ü. °dONLNdÈ‘lfls(‹lYï°dONLNdÍ‘rfl¢) ou set the ï°dONLNdı”¢flÿ)0    dNeedTimeï°dONLNd˛‘ÿfl‚)6 flï°dONLNd‘‚fl)
  6994.  
  6995. ag of the ï°dONLNd ”flE)-    drvrFlagsï°dONLNd‘EflY)6 worg`°dONLNd‘YflÌ)!d if your device driver needs to .°dONLNd9‡lβ(Ël perform some action periodicallyU °dONLNdY‡˛Î)í. .°dONLNd\Úl˝s(˙lYï°dONLNd]Úr˝Δ)ou need to set the ï°dONLNdpÒΔ˝)T dNeedGoodbyeï°dONLNd|Ú˝)H flï°dONLNdÚ˝æ)
  6996. $ag if you want your application to rg`°dONLNd£Úæ˝Á)¶    eceive a .°dONLNd¨˛l    Ø(l
  6997. goodBye Contro†°dONLNdπ˛Ø    Ω)Col rİdONLNdΩ˛æ    Ù) equest befor%°dONLNd…˛Ù    1)6e the heap is rSİdONLNdÿ˛1    d)=
  6998. einitialized.°dONLNdÊl¨(lThe last four flÛ`°dONLNdˆ¨O)@#ags indicate which Device Manager rr`°dONLNdPü)§equests the driverV@°dONLNd+†≠)P’s rüİdONLNd/≠·)
  6999. outines can °dONLNd;l'o($lrE°dONLNd<p'û)
  7000. espond to.°dONLNdG.l9⁄(6lThe next element of the rZİdONLNd`.⁄9Ú)nesour¢¿°dONLNde.Ú9)    ce specifi ¿°dONLNdo.9≥)(#es the time between periodic tasks.°dONLNdì@lK‹(HlThe next two elements prÅ¿°dONLNd´@‹KÂ)p:ovide an event mask and menu ID for desk accessories. The °dONLNdÂLlWç(Tlsection ËİdONLNdÌLçWú)!“W+ °dONLNdÔLúW◊)riting a Desk °dONLNd˝L◊W9);Accessory” on page 2-^@°dONLNdL9WC)b31^@°dONLNdLCWê)
  7001.  describes these fi ‡°dONLNd'LêW§)Melds.°dONLNd-^liw(flOfÇ °dONLNd/^wi ) fsets to the driver rİdONLNdD^Àig)T#outines follow the desk accessory fi,İdONLNdh^gi¡)úelds. See the section P °dONLNd~^¡iÓ)Z
  7002. “Entering °dONLNdàjlu´(rland Exiting Fry@°dONLNdñj´u)?om Driver SubrQ°dONLNd§juE)Eoutines” on page 2-F°dONLNd∑jFuK)V9F°dONLNd∏jKun) for morİdONLNd¿jouŸ)$e information about the °dONLNdÿvlÅ(~lsubr¿°dONLNd‹vÄÅß)    outine ofn‡°dONLNdÂvßÅΩ)'fsets.°dONLNdÏàlì˜(êl The next element of the driver r3¿°dONLNd à¯ì)åesour|°dONLNdàìq)ce is the driver name. S@°dONLNd(àqìw)aY¿°dONLNd)àwì√)ou can use upper˘¿°dONLNd9à¬ìÍ)K    case and °dONLNdBîlüÖ(úllower√İdONLNdGîÖü*)$case letters when naming your driver6@°dONLNdkî*üV)• , but the fiÒİdONLNdwîVüÎ),!rst character should be a period—.°dONLNdòül´Æ(®l .YourDriver¬†°dONLNd£†≠´Ì)A, for example.ˇ Ë@ˇ ˇˇˇˇ@
  7003. ˇ·ˇ‚7^
  7004. 4H\, Palatino
  7005. .+ä"CHAPTER œ´)\2,     Helvetica
  7006.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äSummary
  7007. ~¿(‡2
  7008. ‡)-a¿)41
  7009. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  7010. 1/91(¯ä Second line.4^H¿
  7011. °dONLNd]ähê(eäY@İdONLNd]êh√) our driver rŒ°dONLNd
  7012. ]√h·)3?outines, which follow the driver name, must be aligned on a worΔ¿°dONLNdL]·hÈ(e·d °dONLNdNiätµ(qäboundary◊`°dONLNdVi¥t∂)*.°dONLNdX{äÜæ(Éä The section $@°dONLNdd{øÜœ)5“Cr@°dONLNdg{œÜ2)eating a Driver ResourΔ °dONLNd}{2Üp)cce” on page 2-u†°dONLNdã{qÜv)?5u†°dONLNdå{vܬ) discusses this str≈‡°dONLNdü{¬ÜŸ)LucturK¿°dONLNd§{⁄Ü) e in detail.
  7013. ãH¶4åH¶
  7014. ∑Hø4∏Hø ∏H∏
  7015. ˇ·ˇ‚7^
  7016. ˇˇ£‰ˇÆ°dONLNd±§H∂í(≤HSummaryˇˇˇˇˇˇ⁄|(≤ 2
  7017. °dONLNdπ»ä”B(–ä+This section lists the declarations and defi©°dONLNd»B”j)∏
  7018. nitions fr™@°dONLNdÔ»j”Æ)(om this chapter±‡°dONLNd˛»Æ”≥)D. Ñ@°dONLNd»≥”π)YD¿°dONLNd»π”)ou might want to °dONLNd‘äfl(‹äWsupplement this information with the information in the summary section of the chapter °dONLNdi‡äÎÍ* “The Device Manager_¿°dONLNd|‡ÍÎ*)`,” in this book.
  7019. H 4H  H
  7020. ˇ·ˇ‚7^
  7021. °dONLNdç
  7022. H}(H    Constants,
  7023. Courier
  7024. .°dONLNdó&H2¥*{Chooser messages}°dONLNd™>HJñ*
  7025. CONST initMsg°dONLNdΩ>ÆJ¥)f=°dONLNdø>¿J“)11;°dONLNdƒ>‰JŒ)$'{the user selected this device package}°dONLNdÌLTXê(UT
  7026.  newSelMsg°dONLNd¸LÆX¥)Z=°dONLNd˛L¿X“)12;°dONLNdL‰X¬)$%{the user made new device selections}°dONLNd*ZTfú(cT  fillListMsg°dONLNd;ZÆf¥)Z=°dONLNd=Z¿f“)13;°dONLNdBZ‰f∂)$#{fill the device list with choices}°dONLNdghTtê(qT
  7027.  getSelMsg°dONLNduhút¢)H °dONLNdwhÆt¥)=°dONLNdyh¿t“)14;°dONLNd~h‰t»)$&{mark one or more choices as selected}°dONLNd¶vTÇê(T
  7028.  selectMsg°dONLNd¥vúÇ¢)H °dONLNd∂vÆÇ¥)=°dONLNd∏v¿Ç“)15;°dONLNdΩv‰ÇÜ)${the user made a selection}°dONLNd⁄ÑTêú(çT  deselectMsg°dONLNdÍÑúê¢)H °dONLNdÏÑÆê¥)=°dONLNdÓÑ¿ê“)16;°dONLNdÛщê§)$ {the user cancelled a selection}°dONLNdíTû¢(õT
  7029.  terminateMsg°dONLNd#í¢û®)N °dONLNd(íÆû¥) =°dONLNd*í¿û“)17;°dONLNd/í‰û∂)$#{allows device package to clean up}°dONLNdT†T¨ê(©T
  7030.  buttonMsg°dONLNdb†ú¨¢)H °dONLNdd†Æ¨¥)=°dONLNdf†¿¨“)18;°dONLNdk†‰¨å)${the user selected a button}ˇÑ@ˇ ˇˇˇˇ@
  7031. ˇ·ˇ‚7^
  7032. 4*\˜, Palatino
  7033. .+l"CHAPTER œ´)\2,     Helvetica
  7034.     (@lW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄*˙¯
  7035. (‡*2 )-c)42
  7036.     )9Summary
  7037. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  7038. 1/91(¯l Second line.4^*¿¯
  7039. j*o¯4j*o¯ k*k˛
  7040. ˇ·ˇ‚7^
  7041. °dONLNd\*iM(f*Data T˘@°dONLNd\Lid)"ypes,
  7042. Courier
  7043. .°dONLNd u*Åê(~*TYPE DCtlEntry = °dONLNdÉ*è6*  °dONLNdÉ6è<)  °dONLNd!É<è`)RECORD°dONLNd*ëHùä+  dCtlDriver:°dONLNd:ë¢ù∫)ZPtr;°dONLNdBëÍùò)H{ pointer or handle to driver°dONLNdlë‘ù⁄)Í}°dONLNdpüH´Ñ(®H
  7044. dCtlFlags:°dONLNdü¢´“)ZInteger;°dONLNdãüÍ´)H{ flags°dONLNdüü‘´⁄)Í}°dONLNd£≠Hπ~(∂H    dCtlQHdr:°dONLNd±≠¢π¿)ZQHdr;°dONLNd∫≠Íπò)H{ driver request queue header°dONLNd‰≠‘π⁄)Í}°dONLNd˪H«ñ(ƒH
  7045. dCtlPosition:°dONLNd˙ª¢«“)ZLongInt;°dONLNdªÍ«Œ)H&{ byte position used by I/O operations°dONLNd9ª‘«⁄)Í}°dONLNd=…H’ê(“H dCtlStorage:°dONLNdN…¢’Ã)ZHandle;°dONLNdY…Í’¬)H${ handle to driver’s private storage°dONLNdä…‘’⁄)Í}°dONLNdé◊H„ä(‡H dCtlRefNum:°dONLNdû◊¢„“)ZInteger;°dONLNd™◊Í„Ä)H{ driver reference number°dONLNd–◊‘„⁄)Í}°dONLNd‘ÂHÒñ(ÓH
  7046. dCtlCurTicks:°dONLNdÊ¢ғ)ZLongInt;°dONLNdÚÂÍÒP)H{ used internally°dONLNd‘Ò⁄)Í}°dONLNdÛHˇä(¸H dCtlWindow:°dONLNd$Û¢ˇfi)Z
  7047. WindowPtr;°dONLNd2Û͡ò)H{ pointer top driver’s window°dONLNd\Û‘ˇ⁄)Í}°dONLNd`H
  7048. Ñ(
  7049. H
  7050. dCtlDelay:°dONLNdo¢
  7051. “)ZInteger;°dONLNd{Í
  7052. ™)H { ticks between periodic actions°dONLNd®‘
  7053. ⁄)Í}°dONLNd¨HÑ(H
  7054. dCtlEMask:°dONLNdª¢“)ZInteger;°dONLNd«Íº)H#{ event mask (for desk accessories)°dONLNd˜‘⁄)Í}°dONLNd˚H)~(&H    dCtlMenu:°dONLNd    ¢)“)ZInteger;°dONLNdÍ)™)H { menu ID (for desk accessories)°dONLNdB‘)⁄)Í}°dONLNdD+*70(4* °dONLNdE+076) °dONLNdF+67<) °dONLNdH+<7T)END;°dONLNdM9*E0(B* °dONLNdN90E6) °dONLNdP96Ef)DCTlPtr °dONLNd^9¢E®)l=°dONLNd`9¥Eˆ) ^DCtlEntry;°dONLNdlG*S0(P* °dONLNdmG0S6) °dONLNdoG6Sr)
  7055. DCtlHandle°dONLNdG¢S®)l=°dONLNdÅG¥SÍ)    ^DCtlPtr;°dONLNdçm6yf(v6AuxDCE= °dONLNdñ{*á6(Ñ*  °dONLNdô{6áZ) RECORD°dONLNd¢âHïä+ dCtlDriver:°dONLNd≤â¢ï∫)ZPtr;°dONLNd∫âÍïí)H{pointer or handle to driver°dONLNd◊âíïò)®}°dONLNd€óH£Ñ(†H
  7056. dCtlFlags:°dONLNdÍ󢣓)ZInteger;°dONLNdˆóÍ£)H{flags°dONLNd˛ó£)$}°dONLNd•H±~(ÆH    dCtlQHdr:°dONLNd•¢±¿)ZQHdr;°dONLNd•ͱò)H{driver request queue header}°dONLNd9≥Høñ(ºH
  7057. dCtlPosition:°dONLNdK≥¢ø“)ZLongInt;°dONLNdW≥Íø»)H%{byte position used by I/O operations°dONLNdâ≥‘ø⁄)Í}°dONLNdç¡HÕê( H dCtlStorage:°dONLNdû¡¢ÕÃ)ZHandle;°dONLNd©¡ÍÕº)H#{handle to driver’s private storage°dONLNd÷¡ºÕ¬)“}°dONLNd⁄œH€ä(ÿH dCtlRefNum:°dONLNdÍœ¢€“)ZInteger;°dONLNdˆœÍ€z)H{driver reference number°dONLNdœz€Ä)ê}°dONLNd›HÈñ(ÊH
  7058. dCtlCurTicks:°dONLNd,›¢È“)ZLongInt;°dONLNd8›ÍÈJ)H{used internally°dONLNdM›JÈP)`}°dONLNdQÎH˜ä(ÙH dCtlWindow:°dONLNda΢˜fi)Z
  7059. WindowPtr;°dONLNdoÎ͘í)H{pointer top driver’s window°dONLNdîÎí˜ò)®}°dONLNdò˘HÑ(H
  7060. dCtlDelay:°dONLNdߢ¢“)ZInteger;°dONLNd≥˘Í§)H{ticks between periodic actions°dONLNd‹˘§™)∫}°dONLNd‡HÑ(H
  7061. dCtlEMask:°dONLNdÔ¢“)ZInteger;°dONLNd˚Í∂)H"{event mask (for desk accessories)°dONLNd(∂º)Ã}°dONLNd,H!~(H    dCtlMenu:°dONLNd:¢!“)ZInteger;°dONLNdFÍ!§)H{menu ID (for desk accessories)°dONLNdo§!™)∫}°dONLNds#H/~(,H    dCtlSlot:°dONLNdÅ#¢/“)ZInteger;°dONLNdç#Í/)H{slot°dONLNdì#/)}°dONLNdó1H=Ñ(:H
  7062. dCtlSlotId°dONLNd¶1¢=“)ZInteger;°dONLNd≤1Í=)H{slot ID°dONLNdº1= )0}°dONLNd¿?HKñ(HH
  7063. dCtlDevVBase:°dONLNd“?¢K“)ZInteger;°dONLNdfi?ÍK™)H {base address of card for driver°dONLNd?™K∞)¿}°dONLNd MHY~(VH    reserved:°dONLNdM¢Y“)ZInteger;°dONLNd&MÍYn)H{reserved; should be 0°dONLNdCMnYt)Ñ}°dONLNdG[Hgä(dH dCtlExtDev:°dONLNdW[¢g“)ZInteger;°dONLNdc[Íg\)H{external device ID°dONLNd|[\gb)r}°dONLNdÄiHu~(rH    fillByte:°dONLNdéi¢u“)ZInteger;°dONLNdöiÍu )H    {reserved°dONLNd¶i u&)6}°dONLNd®w*É0(Ä* °dONLNd©w0É6) °dONLNd™w6É<) °dONLNd¨w<ÉT)END;°dONLNd±Ö*ë0(é* °dONLNd≤Ö0ë6) °dONLNd≥Ö6ë<) °dONLNdµÖ<ëx)
  7064. AuxDCEPtr °dONLNd≈Ö¢ë®)f=°dONLNd«Ö¥ë‰)^AuxDCE;°dONLNd–ì*ü0(ú* °dONLNd—ì0ü6) °dONLNd”ì6ü~) AuxDCEHandle°dONLNdÂì¢ü®)l=°dONLNdÁì¥üˆ) ^AuxDCEPtr;ˇ@ˇ ˇˇˇˇ@
  7065. ˇ·ˇ‚7^
  7066. 4H\, Palatino
  7067. .+ä"CHAPTER œ´)\2,     Helvetica
  7068.     (@äW’ê)riting ´∞)Yÿ)our Own Device Driver4⁄ä˙(‡äSummary
  7069. ~¿(‡2
  7070. ‡)-a¿)43
  7071. (ÔäDraft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  7072. 1/91(¯ä Second line.4^H¿
  7073. xH}4xH} yHy
  7074. ˇ·ˇ‚7^
  7075. °dONLNdjHww(tHRoutines
  7076. °dONLNd    çHô√*"Driver Support Routines,
  7077. Courier
  7078. .°dONLNd!†H¨“*FUNCTION GetDCtrlEntry °dONLNdB†Ú¨¨)™(refNum: Integer) : DCtlHandle;
  7079. ›H„4fiH„ flHfl
  7080. ˇ·ˇ‚7^
  7081. .°dONLNdb–H›¯(⁄HAssembly-Language Information
  7082. °dONLNdÄÛHˇ‘*"Routines Requiring Jump VJ»°dONLNdôÛ‘ˇ)åectors
  7083.     °dONLNd†
  7084. Hi(HRoutine°dONLNd®
  7085. ¬‚)zJump VÅ°dONLNdÆ
  7086. ‚˜) ector
  7087. °dONLNd¥H$_(!HFetch°dONLNd∫¬$›)zJFetch°dONLNd¡)H4_(1HStash°dONLNd«)¬4‹)zJStash°dONLNdŒ9HDk(AHIODone°dONLNd’9¬DË)zJIODoneˇ¯@ˇ ˇˇˇˇ@
  7088. ˇ·ˇ‚7^
  7089. 4⁄∫˙,     Helvetica
  7090.     .(‡∫Contents
  7091. 
  7092. ‡(‡3ù)-‡)1
  7093. (Ô∫Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  7094. 1/91(¯∫ Second line., Palatino
  7095.         (#∫CHAPTER )~3
  7096. ~H-4~H- H
  7097. °dONLNdˇˇ('∫Contents
  7098. ˇ·ˇ‚7^
  7099. ˇˇf|ˇÆ°dONLNd[∫zû(t∫The Slot Manager
  7100. °dONLNd=∫H *—Intr∑@°dONLNd= H:)oduction to Slots and CarœÄ°dONLNd.=:HD)pds(@°dONLNd2=YHf)3-3°dONLNd6JƒU€(RƒAddrC¿°dONLNd:J‹U)ess allocationslİdONLNdKJ/U<)S3-5°dONLNdOWƒbÍ(_ƒFirmwar⁄ °dONLNdVWÍbÓ)&e£¿°dONLNdYWb)3-7°dONLNd]dŒo(lŒThe format blockÛ°dONLNdod-o:)_3-7°dONLNdsqŒ|(yŒ The sResourÔ°dONLNd~q|)6ce dirr°dONLNdÑq|8)ectoryÂİdONLNdåqL|Y)/3-8°dONLNdê~ŒâÒ(ÜŒsResour≥@°dONLNdó~Òâ )# ce Data StrMİdONLNd¢~!â8)0uctur”`°dONLNdß~8âA)es⁄°dONLNd´~Uâb)3-8°dONLNdØãŒñÒ(ìŒsResour≥@°dONLNd∂ãÒñ)#ce T߇°dONLNd∫ãñO)ypes and sResour` °dONLNd ãPñz)Nce NamesCİdONLNd‘ãèñ°)?3-10°dONLNdŸòŒ£ı(†ŒThe Boar°dONLNd·òˆ£!)(    d sResour·°dONLNdÍò!£*)+ce‡°dONLNdÓò?£L)3-1‚ °dONLNdÒòK£P) 1°dONLNdÛ•∫∞#(≠∫About the Slot Manager]@°dONLNd •8∞J)~3-12°dONLNd≤∫Ω"(∫∫Using the Slot ManagerúİdONLNd(≤6ΩH)|3-14°dONLNd-øƒ _(«ƒ Enabling and Disabling NuBus Car@İdONLNdMø` j)údsô@°dONLNdQø~ ê)3-14°dONLNdVÃ◊P(‘ƒDeleting and Restoring sResouråİdONLNdtÃP◊)å ce Data Str&¿°dONLNdÃÄ◊ó)0uctur¨†°dONLNdÑÃó◊†)es≥@°dONLNdàÃ¥◊Δ)3-15°dONLNd矃‰R(·ƒEnabling and Disabling sResoura‡°dONLNd´ŸR‰Å)é ce Data Str¸ °dONLNd∂ŸÅ‰ò)/ucturǰdONLNdªŸô‰¢)esà†°dONLNdøŸ∂‰»)3-15°dONLNdƒʃÒ÷(ÓƒSearN`°dONLNd»Ê◊Ò$)ching for sResour» °dONLNdŸÊ$ÒS)M ce Data Strb`°dONLNd‰ÊTÒk)0ucturË@°dONLNdÈÊkÒt)esÓ‡°dONLNdÌÊàÒö)3-16°dONLNdÚÛƒ˛&(˚ƒGetting Information fr¿°dONLNdÛ'˛[)c
  7101. om sResourˇÄ°dONLNdÛZ˛â)3 ce Data Strô¿°dONLNdÛ䲰)0uctur†°dONLNd"Û¢˛´)es&@°dONLNd&Ûø˛—)3-18°dONLNd+∫ —(∫Refer⁄ °dONLNd0— =)ence to the Slot Manager∂@°dONLNdJR d)Å3-20°dONLNdO
  7102. ƒÁ(ƒData Str``°dONLNdW
  7103. ˡ)$ucturÊ@°dONLNd\
  7104. ˇ)esχ°dONLNd`
  7105. .)3-20°dONLNdeƒ%("ƒDetermining the V’‡°dONLNdv%â)Qersion of the Slot Manager °dONLNdíû%∞)â3-22°dONLNdó'ƒ2 (/ƒFinding sResour‡¿°dONLNd¶' 2;)H ce Data Str{°dONLNd±'<2S)0uctur‡°dONLNd∂'T2])esİdONLNd∫'q2É)3-24°dONLNdø4ƒ?Æ(<ƒ4Enabling, Disabling, Deleting, and Restoring sResourN°dONLNdÛ4Ø?∏)Îce°dONLNdˆ?ƒJÁ(GƒData Str``°dONLNd˛?ËJˇ)$ucturÊ@°dONLNd?ˇJ)esχ°dONLNd?J.)3-35°dONLNd LƒW&(TƒGetting Information fr¿°dONLNd"L'W[)c
  7106. om sResourˇÄ°dONLNd,LZWâ)3 ce Data Strô¿°dONLNd7LäW°)0uctur†°dONLNd<L¢W´)es&@°dONLNd@LøW—)3-40°dONLNdEYƒdr(aƒ%Loading Drivers and Executing Code fr∂ °dONLNdjYrd¶)Æ
  7107. om sResour≤‡°dONLNdtY¶d±)4ce °dONLNdxdƒoÁ(lƒData Str``°dONLNdÄdËoˇ)$ucturÊ@°dONLNdÖdˇo)esχ°dONLNdâdo.)3-53°dONLNdéqƒ| (yƒT∫¿°dONLNdèq…|)raversing Firmwaro‡°dONLNd†q|o)Se of Expansion Car„°dONLNd≤qo|y)Sds;¿°dONLNd∂qé|†)3-57°dONLNdª~ƒâ|(܃'Getting Information about Expansion CarꆰdONLNd‚~|âú)∏ds and °dONLNdÍâƒî(ëƒDeclaration ROMs‡°dONLNd¸â*î<)f3-58°dONLNdñƒ°Á(ûƒGetting ⁄°dONLNd    ñÁ°S)#Access to Expansion Car]`°dONLNd ñT°´)mds’ Parameter RAM`°dONLNd3ñ¿°“)l3-65°dONLNd8£∫Æ>(´∫Summary of the Slot Manager    `°dONLNdU£SÆe)ô3-69ˇå@ˇ ˇˇˇˇ@
  7108. ˇ·ˇ‚7^
  7109. 4*\˜, Palatino
  7110. .+ú"CHAPTER œ´)\34⁄*˙¯,     Helvetica
  7111. (‡*3 )-c)2
  7112.     )iContents
  7113. *Draft. Preliminary6a):, ConfiÒë)dential. ©1991 µ)1Apple Computer®-)6, Inc. Ñ    )10/1π¥)
  7114. 1/91(¯ú Second line.4^*¿¯ˇ L@ˇ ˇˇˇˇ@
  7115. ˇ·ˇ‚7^, Palatino
  7116. .+ä"CHAPTER 
  7117. 4⁄ä˙,     Helvetica
  7118.     (‡äIntroduction to Slots and Cards
  7119. 
  7120. ‡(‡3ù)-‡)3
  7121. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/92("È3
  7122.     ˇˇ—ÚˇÆ°dONLNd8äCŒ(@äThe Slot Managerˇˇˇˇˇˇ≠>(@3
  7123. °dONLNd\äh(eäYThis chapter describes how your application or device driver can use the Slot Manager to °dONLNdjhätÏ* identify expansion carî °dONLNdÄhÏtw)bds and communicate with the fib °dONLNdûhxtñ)årmwarD¿°dONLNd£hñtŒ)
  7124. e on each car¿°dONLNd∞hœt◊)9d.°dONLNd≥zäÜê(ÉäY@İdONLNd¥zêÜ\).ou need to use the Slot Manager only if you ar‡°dONLNd‚z\Ü˙)Ã%e writing an application or a device °dONLNdÜäíÈ(èädriver that must addr`°dONLNdÜÍíD)`ess an expansion car†°dONLNd0ÜDíY)Zd dirgİdONLNd5ÜYím)ectly?İdONLNd:Ümí)#. For example, you need to use the °dONLNd]íäûÏ(õäSlot Manager if you arˇ°dONLNdsíÏû{)b"e writing a driver for a video car9‡°dONLNdïí|û)êd, but not if you only want to °dONLNd¥ûä™ù(ßä>display information on a monitor for which a device driver alr≠†°dONLNdÚûù™–(ßù eady exists.°dONLNdˇ∞争(πäThe Slot Manager prÙ‡°dONLNd∞‰º)Zovides r``°dONLNd∞ºq)$outines to help you searÙİdONLNd2∞qºä)ich thr釰dONLNd8∞ãº÷)ough the data strÖİdONLNdI∞÷ºÌ)Kuctur `°dONLNdN∞Óº
  7125. )es that °dONLNdVºä»«(≈ä
  7126. expansion carg@°dONLNdcº«»˙)= ds use to or@ °dONLNdoº˙»â)3!ganize the information in their fiÍ@°dONLNdëºâ»ß)èrmwarǰdONLNdñºß»)e. The meaning of the °dONLNd¨»ä‘˛(—äinformation in the data str醰dONLNd«»˛‘)tucturİdONLNdû‘E) es varies frª‡°dONLNdÿ»E‘c)/om car∫†°dONLNdfi»c‘Ñ)d to car√İdONLNdʻёÒ)!d; you need to know the °dONLNd˛‘䇶(›äspecifiÓ °dONLNd‘¶‡—) cs of a car°dONLNd‘“‡Ô),d in or*°dONLNd‘Ô‡*)der to interpr9`°dONLNd%‘*‡b);et its data strÈ@°dONLNd4‘b‡y)8ucturo °dONLNd9‘z‡à)es. °dONLNd>ÊäÚÕ(ÔäThis chapter pr°°dONLNdMÊÕÚ)Covides a brief intrà¿°dONLNd`ÊÚP)N oduction to \İdONLNdlÊPÚ˛)5$Apple’s implementation of NuBus and °dONLNdêÚ䲫(˚ä
  7127. expansion carg@°dONLNdùÚ«˛˚)=
  7128. ds. This intr†°dONLNd™Ú¸˛c)5oduction explains the fi–İdONLNd¬Úc˛Å)grmwar≥ °dONLNd«ÚŞ©)
  7129. e data str8‡°dONLNd—Ú™˛¡))ucturæ¿°dONLNd÷Ú¡˛)es, but does not °dONLNdÁ˛ä
  7130. t(ä5give much detail about the information these data str¸ °dONLNd˛t
  7131. ã)ÍucturǰdONLNd!˛å
  7132. √)
  7133. es contain. TÒ†°dONLNd.˛¬
  7134. Ë)6    o interprf†°dONLNd7˛È
  7135.  )'    et these °dONLNd@
  7136. ä´(ädata strº °dONLNdH
  7137. ´¬)!ucturB°dONLNdM
  7138. √v)(es, you need to know the information in å °dONLNdu
  7139. v )≥$Designing Cards and Drivers for the °dONLNdôä"”(äMacintosh Family)‡°dONLNd©”"X)I, as well as information specifiæ¿°dONLNd…X"á)Ö c to the caryİdONLNd’à"®)0d you’r≠@°dONLNd‹®"‡)  e examining.°dONLNdÈ(ä4Ø(1ä    If you ar °dONLNdÚ(∞4/)&e designing an expansion carπİdONLNd(/4j)
  7140. d, you must rİdONLNd(k4})<ead e‡°dONLNd(}4)$Designing Cards and Drivers for the °dONLNdC4ä@”(=äMacintosh Family)‡°dONLNdS4”@˝)I . If you ar≠°dONLNd^4˝@•)*(e writing a driver for a device on a carÛ °dONLNdÜ4•@¸)®d, you should also r↰dONLNdö4˝@)Xead °dONLNdû@äLL(Iä(the chapters “The Device Manager” and “W©†°dONLNdΔ@LLf)¬riting b@°dONLNdÕ@gLm)Y"¿°dONLNdŒ@mL)$our Own Device Driver” in this book.°dONLNdÛRä^√([äAfter the intr8@°dONLNdRƒ^{):'oduction to the NuBus and expansion carR°dONLNd(R{^)∑!d design, this chapter discusses °dONLNdI^äj¬(gä how you can,
  7141.  
  7142. Zapf Dingbats
  7143. °dONLNdUsäzè*n
  7144. °dONLNdWpñ|ó) ;determine the version of the Slot Manager that is available
  7145. °dONLNdìÖäåè(ãän
  7146. °dONLNdïÇñéú) fiå¿°dONLNdóÇúé)nd information in the fiŸ °dONLNdØÇé!)grmwarª¿°dONLNd¥Ç!é})e of an expansion cará`°dONLNd…Ç~éÑ)]d
  7147. °dONLNdÀóäûè(ùän
  7148. °dONLNdÕîñ† ) enable and disable data strx†°dONLNdËî †#)vuctur˛Ä°dONLNdÌî#†v)es in expansion car¶ °dONLNdîw†Ö)Td fiN†°dONLNdî܆§)rmwar1@°dONLNd    î§†®)e
  7149. °dONLNd ©ä∞è(Øän
  7150. °dONLNd
  7151. ¶ñ≤#)  load drivers and execute code fr @°dONLNd-¶$≤q)éom expansion car—°dONLNd=¶q≤)Md fiyİdONLNdA¶Ä≤û)rmwar\ °dONLNdF¶û≤¢)e
  7152. °dONLNdHªä¬è(¡än
  7153. °dONLNdJ∏ñƒ&) !check the status of expansion carİdONLNdk∏'ƒ1)ëds
  7154. °dONLNdnÕä‘è(”än
  7155. °dONLNdp ñ÷ô) rE°dONLNdq ö÷L)%ead and change the slot parameter RAM
  7156. €Hˆ4‹Hˆ
  7157. H4H H
  7158. ˇ·ˇ‚7^
  7159. ˇˇ£‰ˇÆ°dONLNdóÙH3(HIntroduction to Slots and Cardsˇˇˇˇˇˇ⁄|( 3
  7160. °dONLNd∑ä#e( ä/The Macintosh family of computers supports a prh°dONLNdÊe#Ö)€ocessorÀ‡°dONLNdÌÖ#ï) -dirˇ°dONLNdÒï#)ect slot (PDS) expansion °dONLNd
  7161. #ä/I(,ä+interface and a NuBus expansion interface. °dONLNd65äAù*The ª¿°dONLNd:5ùA»)    processor‡ °dONLNdC5»A˚)+
  7162. -direct slot,ÚİdONLNdP5˚A    )3 or Z†°dONLNdT5
  7163. A!)PDS,f°dONLNdX5!AÇ) is connected to the prQ‡°dONLNdo5ÇA)aocessor bus, which gives it dir¿°dONLNdé5A)Öect °dONLNdíAäM◊(Jäaccess to the micr´°dONLNd§A◊MÊ)MoprÁ†°dONLNdßAÊM.)ocessor and ther†°dONLNd∑A/M@)Iefor`†°dONLNdªA@M)+e a speed advantage over the NuBus. However>¿°dONLNdÊAM)œ, °dONLNdËMäYî(Vä=since the PDS expansion interface is an extension of the micr◊¿°dONLNd    %MîY£(Vîopr`°dONLNd    (M§Yƒ)ocessorËİdONLNd    /M√Yÿ), the °dONLNd    5Yäeü(bäconfiC‡°dONLNd    :Y†eÇ)2guration of the slot connector depends on which prj‡°dONLNd    lYÇe)‚ocessor is used by the computer√†°dONLNd    ãYe)å. °dONLNd    çeäqÔ(näFor information specifi†¿°dONLNd    §eÔqS)ec to PDS expansion car6¿°dONLNd    ∫eTqs)eds, see fl¿°dONLNd    ¬esq    )$Designing Cards and Drivers for the °dONLNd    Êqä}”(zäMacintosh FamilyÁ@°dONLNd    ˆq”}’)I.°dONLNd    ¯ïä°\(ûä.The Macintosh II-family computers include the ¿°dONLNd
  7164. &ï]°|)”NuBusª‡°dONLNd
  7165. +ï|°Ì) expansion interface with °dONLNd
  7166. E°ä≠ü(™äconfiC‡°dONLNd
  7167. J°†≠˘)gurations ranging fr0@°dONLNd
  7168. ^°˘≠ )Y>om one to six identical slot connectors. The Macintosh system °dONLNd
  7169. ú≠äπß(∂äuses a  ¿°dONLNd
  7170. £≠ßπΔ)slot ID)`°dONLNd
  7171. ™≠«πò) 1 in the range $09 to $0E to identify NuBus slots.ˇƒ@ˇ ˇˇˇˇ@
  7172. ˇ·ˇ‚7^
  7173. 4*\˜, Palatino
  7174. .+l"CHAPTER €`)\3,     Helvetica
  7175.     (@lThe Slot Manager4⁄*˙¯
  7176. (‡*3 )-c)4
  7177.     )9Introduction to Slots and Cards
  7178. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  7179. ^*j¯4^*j¯
  7180. °dONLNdˇˇ(elNOTE
  7181. ˇ·ˇ‚7^
  7182. °dONLNdglsÒ* For convenience, this section rìİdONLNdgÒsR)Öefers to a NuBus confi€‡°dONLNd5gRs†)aguration with six °dONLNdGslÜ(|lslots rfl@°dONLNdNsÜî)eprp°dONLNdQsï    )esented by slot IDs $09 thrfi‡°dONLNdls    ä)tough $0E. Keep in mind that °dONLNdàlãî(àlAsome Macintosh family computers use only some of these slot IDs. °dONLNd…ãlój* :For example, the Macintosh IIcx uses only slot IDs $09 thr"@°dONLNdãkóô)ˇ
  7183. ough $0B. °dONLNd
  7184. ól£}(†lSee ”°dONLNdó}£!)%Guide to the Macintosh Family Hardwar‡°dONLNd6ó"£%)•ecİdONLNd7ó&£I) for mor.°dONLNd?óJ£ã)$e information. ,
  7185.  
  7186. Zapf Dingbats
  7187. 3°dONLNdˇˇ)Du
  7188. °dONLNdc©lµ1(≤l-In the Macintosh II-family of computers, the 0¿°dONLNdê©2µp)Δ
  7189. processor bus™Ä°dONLNdù©pµÔ)> (which connects the CPU to °dONLNdπµl¡‚(ælNRAM, ROM, the FPU) and the NuBus (which connects the NuBus expansion slots) ar€†°dONLNdµ‚¡È(æ‚e °dONLNd    ¡lÕ∞( lconnected by a ‡°dONLNd¡±Õ‹)E    processor%@°dONLNd!¡‹ÕJ)+-bus to NuBus interface,¶°dONLNd9¡JÕX)n or  °dONLNd=¡YÕñ)bus interface,∞‡°dONLNdK¡ñÕœ)=
  7190.  as shown in S‡°dONLNdX¡–ÕË):Figur&†°dONLNd]¡ËÕ˜)e 3-°dONLNdaÕlŸq(÷l1°dONLNdbÕqŸs).
  7191. ˝*¯4˝*
  7192. ¯"˝*_
  7193. ˇ·ˇ‚7^
  7194.     °dONLNdˇˇ(˙l
  7195. Figure 3-1°dONLNddÚÆ˝ )BSimplifi~0°dONLNdlÚÀ˝q)'ed processor-bus and NuBus architecture
  7196. °dONLNdîùl©ù(¶l Both the pr…İdONLNdüùù© )1ocessor bus and the NuBus arÏ °dONLNdªù ©ı)É2e 4 bytes wide. The bus interface transfers bytes °dONLNdÌ©lµ (≤lbetween the buses in 8¿°dONLNd©Àµ˘)_
  7197. byte lanesó`°dONLNd ©˘µ>).. Because the prü@°dONLNd©>µ◊)E!ocessor bus and the NuBus interpr|`°dONLNd=©◊µÒ)ôet the °dONLNdDµl¡á(ælsignifi˚°dONLNdKµá¡¯)cance of bytes within wor>°dONLNddµ˘¡)rds difA °dONLNdjµ¡)fer#†°dONLNdmµ¡4) ently\¿°dONLNdrµ3¡√)!, the bus interface must perform t‡°dONLNdìµ√¡Ô)ê
  7198. byte lane °dONLNdù¡lÕò( lswappingz`°dONLNd•¡ôÕ)- between the two buses. °dONLNdæ”lfl((‹l)The bus interface also performs some addr¿Ä°dONLNdÁ”(fl˜)º/ess translation between the two buses. It maps °dONLNdfllΰ(Ël certain addr% °dONLNd"fl¢Î)6ess ranges on each bus ar%`°dONLNd;flÎ/)oe to dif—@°dONLNdCfl/Î;)fer≥¿°dONLNdFfl;Î`) ent addr
  7199. †°dONLNdNflaÎ⁄)&ess ranges on the other bus.°dONLNdkÒl˝L(˙l4Designing Cards and Drivers for the Macintosh Family“‡°dONLNdüÒL˝—)‡ discusses byte lanes and addrX¿°dONLNdΩÒ“˝·)Üess °dONLNd¡˝l    ª(ltranslation in mor†°dONLNd”˝ª    ›)O    e detail.°dONLNd›l∏(lThe next section, *@°dONLNdÔπ’)M“AddrÓ°dONLNdÙ’)ess allocations,”ñ¿°dONLNdo)G discusses the addr)¿°dONLNdpÊ)Tess ranges assigned by the °dONLNd3l'•($l Macintosh ar*İdONLNd?¶'Ã):    chitecturfl@°dONLNdHÃ'+)&e to each NuBus slot. °dONLNd_-l9†(6l The section $@°dONLNdk-°9Ã)5“Firmwar~`°dONLNds-Ã9ÿ)+e,”»°dONLNdv-ÿ9Ë)  on ‡°dONLNdz-È9    )page 3-=†°dONLNdÅ-    9) 7=†°dONLNdÇ-9 ) intr~¿°dONLNdá- 9s)oduces the data strßİdONLNdö-s9ä)Suctur-`°dONLNdü-ã9£)es carÈ@°dONLNd•-£9œ) d’s use to °dONLNd∞9lEu(Blor∫İdONLNd≤9uEÙ)    ganize information in their fi@°dONLNd–9ıE)Ärmwarȇ°dONLNd’9E)e.
  7200. k*q¯4k*p¯ klk¯
  7201. ˇ·ˇ‚7^
  7202. ˇˇ◊ˇ◊°dONLNdÿYljë(flAddr„@°dONLNd‹YëjÛ)%ess allocationsˇˇˇˇˇˇ®(f3
  7203. °dONLNdÏpl|π(ylThe Macintosh arf@°dONLNd¸pπ|fl)M    chitectur°dONLNdp‡|?)'e assigns certain addr↰dONLNdp?|Ÿ)_#ess ranges to each NuBus slot. The °dONLNd>|làu(ÖlprG °dONLNd@|và<)
  7204. *ocessor communicates with an expansion carÏ@°dONLNdj|<àV)Δd by r„¿°dONLNdp|VàÎ) eading and writing to memory in °dONLNdêàlîë(ëlthe addrŸ‡°dONLNdòàëîÂ)%ess range of the car@°dONLNd¨àÊîA)Ud. The expansion carU°dONLNd¿àAîfl)["ds can also communicate with each °dONLNd‚îl†≈(ùlother in this mannerưdONLNdˆî≈† )Y. °dONLNd˘¶l≤©(Øl The NuBus ar∂†°dONLNd¶©≤œ)=    chitecturk`°dONLNd¶–≤9)'e allows full 32-bit addr=¿°dONLNd'¶9≤^)i    esses, prO °dONLNd0¶^≤Â)%oviding four gigabytes of addrß@°dONLNdN¶Â≤Ù)áess °dONLNdR≤læô(ªl@space. Suitably equipped Macintosh computers with system softwar™¿°dONLNdí≤ôæÊ(ªôe version 7.0 also 
  7205. 
  7206. kܯ4
  7207. kÖ¯
  7208. ™U™U™U™U4U‘W’4UsWt4UtW‘0!wÉú °dONLNdˇˇ(VCPU0/Fvsñ^°dONLNdˇˇ(HSbus ô.°dONLNdˇˇ(ZI    interface48ú:ù48F:G48ù:F4kõmú4kEmF4kúmE0J™\…°dONLNdˇˇ(V∞FPUUU°dONLNdˇˇ)%RAM*™°dONLNdˇˇ)(ROM0J—\0J˘\49    : 4J    K 4:    J 4[    \ 4l    m 4\    l 49‚:‰4J‚K‰4:‚J‰4[·\„4l·m„4\·l„49ª:Ω4JªKΩ4:ªJΩ4[∫\º4l∫mº4\∫lº°dONLNdˇˇ(u”prG °dONLNdˇˇ)
  7209. ocessor bus°dONLNdˇˇ(`úNuBus4V‘W÷4M‘N÷4N‘V÷4VƒWΔ4MƒNΔ4NƒVΔ4V¥W∂4M¥N∂4N¥V∂4V£W•4M£N•4N£V•4VìWï4MìNï4NìVï4VÉWÖ4MÉNÖ4NÉVÖ
  7210. ˇ°dONLNdˇˇ(U"...49+:-4J+K-4:+J-4[+\-4l+m-4\+l-
  7211. 4èMô0èNö
  7212. °dONLNdˇˇ(ì NuBus slots°dONLNdˇˇ(8ëA4üM©0üN™°dONLNdˇˇ)B4ØMπ0ØN∫°dONLNdˇˇ)C4øM…0øN °dONLNdˇˇ)D4œMŸ0œN⁄°dONLNdˇˇ)E4Mâ0Nä°dONLNdˇˇ(8Ç9ˇ9h@ˇ ˇˇˇˇ@
  7213. ˇ·ˇ‚7^
  7214. 4H\, Palatino
  7215. .+ä"CHAPTER €`)\3,     Helvetica
  7216.     (@äThe Slot Manager4⁄ä˙(‡äIntroduction to Slots and Cards
  7217. 
  7218. ‡(‡3ù)-‡)5
  7219. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿
  7220. °dONLNd\ähÒ(eäsupport full 32-bit addr!`°dONLNd\Úh“)h4essing, while earlier versions of the system softwar∫@°dONLNdL\“h)‡
  7221. e use 24-bit °dONLNdYhätü(qäaddr|İdONLNd]hüt7)#essing. This section describes addrÅ`°dONLNdÄh7t )ò3ess space allocation in both the 24-bit and 32-bit °dONLNd≥täÄ©(}ämodes.°dONLNd∫Üäí* In 32-bit mode, the Macintosh arχ°dONLNd⁄Üí?)è    chitectur°†°dONLNd„Ü@íí)'e assigns two addrˆÄ°dONLNdıÜíí)Ress ranges to each NuBus °dONLNdíäû¡(õä
  7222. slot: a 256-m °dONLNdí¬ûß)82egabyte super slot space and a 16-megabyte standar`°dONLNdMíßû‹)Â
  7223. d slot space.°dONLNd[§ä∞+(≠ä%The four gigabytes of the 32-bit addr¿°dONLNdħ,∞ä)¢ess space contain 16 rC†°dONLNdñ§ä∞¯)^egions of 256 megabytes °dONLNdÆ∞äº-(πä&apiece, each of which constitutes the £¿°dONLNd‘∞-ºu)£super slot space“İdONLNd‰∞uº˙)H  for one possible slot ID. Each °dONLNdºä»(≈äsuper slot space spans an addrt °dONLNd"º»z)áess range $s000 0000 thrÍ@°dONLNd:ºz»Ø)i ough $sFFF ±¿°dONLNdEº∞»Δ)6FFFF@°dONLNdIºΔ»·), wher∫@°dONLNdOº·»)    e s is a °dONLNdX»ä‘ı(—ähexadecimal digit $0 thrT¿°dONLNdp»ı‘)kough $FV°dONLNdw»‘)#. °dONLNdz⁄äÊÎ(„äFor example, the addrÀİdONLNdè⁄ÎÊ)aCess ranges $9000 0000 – $9FFF FFFF constitute the super slot space °dONLNd“ÊäÚø(ÔäIfor slot ID $09. Since the Macintosh II family uses only slot IDs $09 thrᇰdONLNdÊøÚ(Ôøough $0E, only six °dONLNd.Úä˛(˚ä!super slot spaces, $9xxx xxxx thr
  7224. ‡°dONLNdOÚ˛s)êough $Exxx xxxx, ar °dONLNdbÚr˛∂)Xe actually used.°dONLNdsäù(
  7225. äThe ª¿°dONLNdwù¯)standard slot spaces `°dONLNdã¯)[ ar`°dONLNdé®) #e 16 megabytes apiece and have addr~`°dONLNd±®)§esses of the form $Fsxx °dONLNd…äfl(äxxxx (that is, $Fs00 >°dONLNdfi‡M)V0000 – $FsFF FFFF) whero¿°dONLNdıMó)me s is the slot ID. ì¿°dONLNd    ó )JAs with super slot spaces, °dONLNd$ä((%äthe Macintosh uses only standar˝Ä°dONLNdC(c)éd slot spaces corr…‡°dONLNdUd(fi)Lesponding to slot IDs $9 thrƒ¿°dONLNdqfi()zough $E °dONLNdy(ä4Î(1ä(that is $F9xx xxxx thr´°dONLNdê(Î4<)aough $FExx xxxx).°dONLNd¢:äF¢(CäFigurR¿°dONLNdß:¢F∂)e 3-2@°dONLNd¨:∂FJ)! shows the super slot and standar„‡°dONLNdÕ:JFÎ)î&d slot subdivisions of the 32-bit addré °dONLNdÛ:ÏF
  7226. )¢essing °dONLNd˙FäRç(OärE°dONLNd˚FéR©)egion.
  7227. uHÜ4vHÜ"vH_
  7228. ˇ·ˇ‚7^
  7229.     °dONLNdˇˇ(sä
  7230. Figure 3-2°dONLNdkÃv$)BNuBus address space
  7231. °dONLNd~ääï(áäIn /‡°dONLNd~ñäÆ) Figur†°dONLNd~Æä¬)e 3-2† °dONLNd#~¬äe)&, the super slot space and the standar“@°dONLNdI~eä‰)£d slot space for slot ID $09 ar>@°dONLNdh~Âä)Ä    e shaded.°dONLNdrêäúo(ôä2In 24-bit mode, the Macintosh system can only addrçİdONLNd§êoú⁄)Âess a fraction of each carÉ`°dONLNdæê⁄ú)kd’s allocated °dONLNdÃúä®ü(•äaddr|İdONLNd–úü®Œ)Eess range. In this mode, the system assigns each slot a one megabyte †°dONLNdúœ®(•œ minor slot °dONLNd ®ä¥•(±äspace.¸@°dONLNd&®•¥S)) The bus interface translates 24-bit addrA`°dONLNdO®T¥ã)Ø
  7232. ess on the pr`°dONLNd\®ã¥)7ocessor bus with the form $sx 
  7233. Öäf4Üäf
  7234. Üäf˘4ÖâÜäò.PoPoÜä’˘”ÍÛˇ˘
  7235. ÍÛˇÄ˙
  7236. ÍÉÛˇÄ˙
  7237. ÍÛˇÄ˙
  7238. ÍÛˇÄ˙ ÎÛˇÄ˙
  7239. ÍÛˇÄ˙
  7240. ÍÛˇÄ˙ ÎÄÛˇû˙
  7241. ÍÛˇÇ˙
  7242. ÍÛˇÉ˙ ÏÛˇÅ˙
  7243. ÍÛˇÅ˙
  7244. ÍÛˇÅ˙ ÏÄÛˇÅ˙˘ÑHB˙ÄÛˇÅ˙˘&DB˜ÛˇÅ˙˘    G\9œôò7s0¸ÛˇÅ˙˘
  7245. Ñ»S?¸|ú¯ÛˇÅ˙˘    &»6S#tlÏ@¸ÛˇÅ˙˘    «Lœò7;∏¸ÛˇÅ˙Ú˛˛ÛˇÅ˙Ú˙ÛˇÅ˙Ú˙ÛˇÅ˙Ó˛ÛˇÅ˙
  7246. ÍÛˇÅ˙
  7247. ÍÛˇÅ˙Ô˝ÛˇÅ˙˙˜ˇ¯˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÅÙ ˇ˙˜ˇ¸˝ÛˇÅ ˇ˙˜ˇ¸˝ÛˇŇÔúÓŒˇ˙˜ˇ¸˝ÛˇÅT”#íˇ˙˜ˇ¸˝ÛˇÅS-íˇ˙˜ˇ¸˝ÛˇÅÁ“Áéˇ˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ ˝˚˜ˇ¸˝ÛˇÅ ˝˚ ˜ˇ˝˝ÛˇÅ”qªôå˚˜ˇ¸˝ÛˇÅÙ£‰Áfi˚˜ˇ¸˝ÛˇÅ¥£gb˚˜ˇ¸˝ÛˇÅ”1π›Ã˚˜ˇ¸@˛ÛˇÅ˛ ˛˚˜ˇ¸@˛ÛˇÅ˛ ˛˚˜ˇ¸˝ÛˇÅ˛ ˛˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˛ÛˇÅ˙˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˛ÛˇÉ˙˚˜ˇ¸˝Ûˇû˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸˛ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸@ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙<˜ˇ¸˝ÛˇÄ˙@˜ˇ¸˝ÛˇÄ˙:\Ã5ú˜ˇ¸˝ÛˇÄ˙SË~H˜ˇ¸ÛˇÄ˙FSnH˜ˇ¸˝ÛˇÄ˙9‹Ë5å˜ˇ¸˝ÛˇÄ˙˛˜ˇ¸˝ÛˇÄ˙˛˜ˇ¸˝ÛˇÄ˙˛˜ˇ¸ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ˇ¸˝ÛˇÄ˙Ó30˜ˇ¸˝ÛˇÄ˙ìO¯˜ˇ¸ÛˇÄ˙
  7248. ùDh˜ˇ¸ÛˇÄ˙Á;∞˜ˇ¸˝ÛˇÅ˙˛Ä˜ˇ¸˝ÛˇÅ˙˛Ä˜ˇ¸˝ÛˇÅ˙˛Ä˜ˇ¸@ÛˇÅ˙˚˜ˇ¸@ÛˇÅ˙˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˝ÛˇÉ¿˚˚˜ˇ¸ÛˇÉ¿˚˚˜ˇ¸˝ÛˇÉ¿˚˚˜ˇ¸˝ÛˇÉ¿˚˚˜ˇ¸˝ÛˇÉÄ˚˚˜ˇ¸˝ÛˇÅÄ˚˚˜ˇ¸ÛˇÅÄ˚˚˜ˇ¸˝ÛˇÅÄ˚˚˜ˇ¸˝ÛˇÅ˙˚˜ˇ¸˝Ûˇøˇ¿¸˚˜ˇ¸˝ÛˇÄN"8˛˚˜ˇ¸ÛˇÄ–6$˛˚˜ˇ¸˝ÛˇÄ\6$˛˚˜ˇ¸˝ÛˇÄR68˛˚˜ˇ¸˝ÛˇÄR*$˛˚˜ˇ¸˝ÛˇÄL*8˛˚˜ˇ¸˛@ÛˇÄ˙˚˜ˇ¸˝Ûˇøˇ¿¸˚˜ˇ¸˝ÛˇÅÄ˚˚˜ˇ¸˝ÛˇÅÄ˚˚˜ˇ¸˝ÛˇÅÄ˚˚˜ˇ¸˛ÛˇÉÄ˚˚˜ˇ¸˝ÛˇÉ¿˚˚˜ˇ¸˝ÛˇÉ¿˚˚˜ˇ¸˝ÛˇÉ¿˚˙˜ˇ¸˛ÛˇÉ¿˚˙˜ˇ¸˛ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˛ÛˇÅ˙˙˜ˇ¸˛ÛˇÅ˙˙˜ˇ¸˝ÛˇÅ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝CÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙˙˜ˇ¸˝ÛˇÄ˙
  7249. ˙˜ˇ¸Ê
  7250. ˙˜ˇ¸Ê
  7251. ˙˜ˇ¸Ê
  7252. ˙˜ˇ¸Ê
  7253. ˙˜ˇ¸Ê
  7254. ˙˜ˇ¸Ê
  7255. ˙˜ˇ¸Ê
  7256. ˙˜ˇ¸Ê
  7257. ˙˜ˇ¸Ê
  7258. ˙˜ˇ¸Ê
  7259. ˙˜ˇ¸Ê
  7260. ˙˜ˇ¸Ê
  7261. ˙˜ˇ¸Ê
  7262. ˙˜ˇ¸Ê
  7263. ˙˜ˇ¸Ê
  7264. ˙˜ˇ¸Ê
  7265. ˙˜ˇ¸Ê
  7266. ˙˜ˇ¸Ê
  7267. ˙˜ˇ¸Ê
  7268. ˙˜ˇ¸Ê
  7269. ˙˜ˇ¸Ê
  7270. ˙˜ˇ¸Ê
  7271. ˙˜ˇ¸Ê
  7272. ˙˜ˇ¸Ê
  7273. ˙˜ˇ¸Ê
  7274. ˙˜ˇ¸Ê
  7275. ˙˜ˇ¸Ê
  7276. ˙˜ˇ¸Ê
  7277. ˙˜ˇ¸Ê
  7278. ˙˜ˇ¸Ê
  7279. ˙˜ˇ¸Ê
  7280. ˙˜ˇ¸Ê
  7281. ˙˜ˇ¸Ê
  7282. ˙˜ˇ¸Ê
  7283. ˙˜ˇ¸Ê
  7284. ˙˜ˇ¸Ê
  7285. ˙˜ˇ¸Ê ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸<Á ˙˜ˇ¸<Á ˙˜ˇ¸<Á ˙˜ˇ¸<Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á
  7286. ˙ıˇ¸Ë
  7287. ˙˜ˇ¸Ê
  7288. ˙˜ˇ¸Ê˙˜ˇ¸ w8Î˙˜ˇ¸à$Î˙˜ˇ¸Ó$Î˙˜ˇ¸ Î˙˜ˇ¸ô$Î˙˜ˇ¸f8Î
  7289. ˙˜ˇ¸Ê
  7290. ˙˜ˇ¸Ê
  7291. ˙˜ˇ¸Ê
  7292. ˙ıˇ¸Ë ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸<Á ˙˜ˇ¸<Á ˙˜ˇ¸<Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á ˙˜ˇ¸Á
  7293. ˙˜ˇ¸Ê
  7294. ˙˜ˇ¸Ê
  7295. ˙˜ˇ¸Ê
  7296. ˙˜ˇ¸Ê
  7297. ˙˜ˇ¸Ê
  7298. ˙˜ˇ¸Ê
  7299. ˙˜ˇ¸Ê
  7300. ˙˜ˇ¸Ê
  7301. ˙˜ˇ¸Ê
  7302. ˙˜ˇ¸Ê”””””””””””””””””””””””””””””Ùÿ0ò˛@` `˛aÄÙÙL`§Ä˛¿ê     ˛ ÄÙÙL†Ñ˝Ä
  7303. @˛AÛÙ†Ñ⁄–ÄÄ
  7304. M4p—E–épÔa˘Ù à6äc@Ä     Eë&öcRë$§ñÄ˙Ùñ@—$îCÄå@    ä#(B(¢Cà@à≈˘Ù§@$K%Ñêí¢K"{ÔÑ%"IO8˘Ù5¿ x8w>ÉÉŇü|}¡•ñÉπ√ñ4«˘ ÓÄÛ˜ ÓÄÛ˜
  7305. ÓÚ8˜””””Ù»0`˝åÔÉÌÙX¿¸ÑDΔÌÙP@˝Hà ÌÙ ‹)Fºh‚hHâJÌÙ (*IìM0(âRÌÙ §(,ë)N 1dÌÙ ¥PHì≠9ê@DÌÙ #êkçH”éBª\ÌÓ@ÈÓ@ËÓÄË””””””””””””””””””ÛÄ@–¸‡ÏÙÄ¿ ¸@ÏÙ ÄÄ ÄÏÙ è<Ñiº◊ @û0ÌÙ Ñíö∂íR5ÄäHÌÙ »£§¢¢9ÄÌÙ I%†—I•,BòÌÙ ˆYIYÙ:§bÌ Û@˝@Ë Û@˝@Ë Û8‡˝‡Ë””” Ù¿‹Ê Ù ˛êÊ Ù  Ê
  7306. ÙB|Å√O<Ë
  7307. Ùçi§ÅAEHË
  7308. ÙI"ÅBäË
  7309. Ù0√$´ Ë
  7310. Ùq¬w“xËÚä"‰Úä$‰Úqÿ‰”””” Ù§¸ È Ùl¸$ÈÙH Ä"ÈÙI£˝Œ–0BÈÙH§¶$ë`BÈÙëB$D°@DÈÙ⁄YHO"ÄHÈÙìÓH5ÄÒ0È”””ò.PoPoÜä’˘”ÍÛˇ˘ ÍÙÄ˙ ÍÇÙÄ˙ ÍÙÄ˙ ÍÙÄ˙ ÎÙÄ˙ ÍÙÄ˙ ÍÙÄ˙ ÎÄÛˇû˙Í˚9û¸Ç˙Í˚VP¸É˙Ï˚2P¸Å˙Í˚^¸Å˙Í˚VP¸Å˙ÏÄ˚9û¸Å˙˘ÑHB˙Ä˚˚Å˙˘&DB˜ÛˇÅ˙˘    G\9œôò7s0¸˚9ú¸Å˙˘
  7311. Ñ»S?¸|ú¯˚VR¸Å˙˘    &»6S#tlÏ@¸˚2R¸Å˙˘    «Lœò7;∏¸˚R¸Å˙Ú˛˛˚VR¸Å˙Ú˙˚9ú¸Å˙Ú˙˚˚Å˙Ó˛ÛˇÅ˙Í˚9å¸Å˙Í˚VR¸Å˙Ô˝˚2`¸Å˙˙˜ˇ¯˝˚`¸Å˙˙˜ ˝˚VR¸Å˙˙˜ ˝˚9å¸ÅÙ ˇ!˙˝œ˝ ˝˚˚Å ˇ˙˝+(˝ ˝ÛˇŇÔúÓŒˇ"˙˝(˝ ˝˚9ú¸ÅT”#íˇ"˙˝/˝ ˝˚VR¸ÅS-íˇ"˙˝+(˝ ˝˚2R¸ÅÁ“Áéˇ˙˝»˝ ˝˚\¸Å˙˙˝¸ ˝˚VR¸Å˙˙˜ ˝˚9ú¸Å˙˙˜ ˝˚˚Å ˝˚˜ˇ¸˝ÛˇÅ ˝˚ ˜
  7312. ˝ÙÅ”qªôå˚˜ ˝˚9à¸ÅÙ£‰Áfi#˚˝œ˝ ˝˚VT¸Å¥£gb#˚˝+(˝ ˝˚2T¸Å”1π›Ã#˚˝(˝ @˛˚\¸Ş ˛#˚˝/˝ @˛˚Vb¸Ş ˛"˚˝+(˝ ˝˚9¢¸Ş ˛˚˝œ˝ ˝ÛˇÅ˙˚˝¸ ˝ÙÅ˙˚˜ ˛˚å¸Å˙˚˜ ˝˚"*r¸"#Å˙˚˜ˇ¸˝˚R¸Å˙˚˜ ˝˚N¸Å˙˚˜ ˝˚à™ ¸àâÅ˙˚˝Œ˝ ˛˚ú¸É˙˚˝+)˝ ˝Ûˇû˙˚˝)˝ ˝ÙÄ˙˚˝)˝ ˝ÙÄ˙˚˝+)˝ ˝ÙÄ˙˚˝Œ˝ ˛ÙÄ˙˚˝¸ ˝ÙÄ˙˚˜ ˝ÙÄ˙˚˜ ˝ÙÄ˙˚˜ˇ¸˝ÛˇÄ˙˚˜ @ÙÄ˙˚˜ ˝ÙÄ˙<˝Δ˝ ˝ÙÄ˙@˝+)˝ ˝ÙÄ˙:\Ã5ú˝0˝ ˝ÙÄ˙SË~H˝0˝ ÙÄ˙FSnH˝+)˝ ˝ÙÄ˙9‹Ë5å˝Δ˝ ˝ÛˇÄ˙˛˝¸ ˝ÙÄ˙˛˜ ˝ÙÄ˙˛˜ ÙÄ˙˚˜ˇ¸˝ÙÄ˙˚˜ ˝ÙÄ˙Ó30˜ ˝ÙÄ˙ìO¯˝Œ˝ ÙÄ˙
  7313. ùDh˝+)˝ ÛˇÄ˙Á;∞˝)˝ ˝ÙÅ˙˛Ä˝.˝ ˝ÙÅ˙˛Ä˝+)˝ ˝ÙÅ˙˛Ä˝Œ˝ @ÙÅ˙˚˝¸ @ÙÅ˙˚˜ ˝ÙÅ˙˚˜ ˝ÙÅ˙˚˜ˇ¸˝ÙÉ¿˚˚˜ ÛˇÉ¿˚˚˜ ˝ÙÉ¿˚˚˝ƒ˝ ˝ÙÉ¿˚˚˝+*˝ ˝ÙÉÄ˚˚˝*˝ ˝ÙÅÄ˚˚˝.˝ ÙÅÄ˚˚˝+1˝ ˝ÙÅÄ˚˚˝—˝ ˝ÙÅ˙˚˝¸ ˝Ûˇøˇ¿¸˚˜ ˝ÙÄN"8˛˚˜ ÙÄ–6$˛˚˜ˇ¸˝ÙÄ\6$˛˚˜ ˝ÙÄR68˛˚˜àå˝ÙÄR*$˛˚˝Δ˝ ˝ÙÄL*8˛˚˝)˝ ˛@ÙÄ˙˚
  7314. ˝"/+˝",˝Ûˇøˇ¿¸˚˝'˝ ˝ÙÅÄ˚˚˝!˝ ˝ÙÅÄ˚˚˝àéŒ˝àå˝ÙÅÄ˚˚˝¸ ˛ÙÉÄ˚˚˜ ˝ÙÉ¿˚˚
  7315. ˜",˝ÙÉ¿˚˚˜ˇ¸˝ÙÉ¿˚˙˜ ˛ÛˇÉ¿˚˙˜ ˛ÙÅ˙˙˜ ˝ÙÅ˙˙˜ ˝ÙÅ˙˙˜ ˝ÙÅ˙˙˜ ˛ÙÅ˙˙˜ ˛ÙÅ˙˙˜ ˝ÙÅ˙˙˜ ˝ÛˇÄ˙˙˜ ˝˚å¸Ä˙˙˜ ˝B˚*R¸Ä˙˙˜ˇ¸˝˚R¸Ä˙˙˜ ˝˚R¸Ä˙˙˜ ˝˚*R¸Ä˙˙˜ ˝˚å¸Ä˙˙˜ ˝˚˚Ä˙˙˜ ˝ÛˇÄ˙˙˜ ˝ÛˇÄ˙
  7316. ˙˜ Ê
  7317. ˙˜ Ê
  7318. ˙˜ Ê
  7319. ˙˜ Ê
  7320. ˙˜ Ê
  7321. ˙˜ˇ¸Ê
  7322. ˙˜ Ê
  7323. ˙˜ Ê
  7324. ˙˜ Ê
  7325. ˙˜ Ê
  7326. ˙˜ Ê
  7327. ˙˜ Ê
  7328. ˙˜ Ê
  7329. ˙˜ Ê
  7330. ˙˜ Ê
  7331. ˙˜ Ê
  7332. ˙˜ Ê
  7333. ˙˜ˇ¸Ê
  7334. ˙˜ Ê
  7335. ˙˜ Ê
  7336. ˙˜ Ê
  7337. ˙˜ Ê
  7338. ˙˜ Ê
  7339. ˙˜ Ê
  7340. ˙˜ Ê
  7341. ˙˜ Ê
  7342. ˙˜ Ê
  7343. ˙˜ Ê
  7344. ˙˜ Ê
  7345. ˙˜ˇ¸Ê
  7346. ˙˜ Ê
  7347. ˙˜ Ê
  7348. ˙˜ Ê
  7349. ˙˜ Ê
  7350. ˙˜ Ê
  7351. ˙˜ Ê
  7352. ˙˜ Ê ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ˇ¸Á ˙˜ Á ˙˜ Á ˙˜ <Á ˙˜ <Á ˙˜ <Á ˙˜ <Á ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ Á
  7353. ˙ıˇ¸Ë
  7354. ˙˜ Ê
  7355. ˙˜ Ê˙˜ w8Î˙˜ à$Î˙˜ Ó$Î˙˜ Î˙˜ ô$Î˙˜ f8Î
  7356. ˙˜ Ê
  7357. ˙˜ Ê
  7358. ˙˜ Ê
  7359. ˙ıˇ¸Ë ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ <Á ˙˜ <Á ˙˜ <Á ˙˜ Á ˙˜ Á ˙˜ Á ˙˜ˇ¸Á ˙˜ Á ˙˜ Á˙˝Δ˝ Á˙˝)˝ Ê˙˝
  7360. )˝ Ê˙˝)˝ Ê˙˝)˝ Ê˙˝Δ˝ Ê˙˝¸ Ê
  7361. ˙˜ Ê
  7362. ˙˜ Ê
  7363. ˙˜ˇ¸Ê
  7364. ˙˜ˇ¸Ê”””””””””””””””””””””””””””””Ùÿ0ò˛@` `˛aÄÙÙL`§Ä˛¿ê     ˛ ÄÙÙL†Ñ˝Ä
  7365. @˛AÛÙ†Ñ⁄–ÄÄ
  7366. M4p—E–épÔa˘Ù à6äc@Ä     Eë&öcRë$§ñÄ˙Ùñ@—$îCÄå@    ä#(B(¢Cà@à≈˘Ù§@$K%Ñêí¢K"{ÔÑ%"IO8˘Ù5¿ x8w>ÉÉŇü|}¡•ñÉπ√ñ4«˘ ÓÄÛ˜ ÓÄÛ˜
  7367. ÓÚ8˜””””Ù»0`˝åÔÉÌÙX¿¸ÑDΔÌÙP@˝Hà ÌÙ ‹)Fºh‚hHâJÌÙ (*IìM0(âRÌÙ §(,ë)N 1dÌÙ ¥PHì≠9ê@DÌÙ #êkçH”éBª\ÌÓ@ÈÓ@ËÓÄË””””””””””””””””””ÛÄ@–¸‡ÏÙÄ¿ ¸@ÏÙ ÄÄ ÄÏÙ è<Ñiº◊ @û0ÌÙ Ñíö∂íR5ÄäHÌÙ »£§¢¢9ÄÌÙ I%†—I•,BòÌÙ ˆYIYÙ:§bÌ Û@˝@Ë Û@˝@Ë Û8‡˝‡Ë””” Ù¿‹Ê Ù ˛êÊ Ù  Ê
  7368. ÙB|Å√O<Ë
  7369. Ùçi§ÅAEHË
  7370. ÙI"ÅBäË
  7371. Ù0√$´ Ë
  7372. Ùq¬w“xËÚä"‰Úä$‰Úqÿ‰”””” Ù§¸ È Ùl¸$ÈÙH Ä"ÈÙI£˝Œ–0BÈÙH§¶$ë`BÈÙëB$D°@DÈÙ⁄YHO"ÄHÈÙìÓH5ÄÒ0È”””ˇ!@ˇ ˇˇˇˇ@
  7373. ˇ·ˇ‚7^
  7374. 4*\˜, Palatino
  7375. .+l"CHAPTER €`)\3,     Helvetica
  7376.     (@lThe Slot Manager4⁄*˙¯
  7377. (‡*3 )-c)6
  7378.     )9Introduction to Slots and Cards
  7379. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  7380. °dONLNd\lhù(el
  7381. xxxx (wher≠`°dONLNd
  7382. \ùhE)1(e s is a slot ID) into 32-bit NuBus addr–İdONLNd2\EhÓ)®'esses of the form $Fs0x xxxx, which is °dONLNdYhltÇ(qlthe fiÍ °dONLNd_hÇt)"rst megabyte of the slot’s standarÂ`°dONLNdÅhtI)í
  7383. d slot space.°dONLNdèzlÜÿ(ÉlFor example, 24-bit addrÙ`°dONLNdßzÿÜ9)lesses in the range $90 rİdONLNdæz:Ü])b0000 thrÀ@°dONLNdΔz]Üà)#    ough $9F 7İdONLNdœzâ܇),FFFF constitute the °dONLNd„Ülí»(èlminor slot space corrÈİdONLNd¯Ü»íZ)\!esponding to slot ID $09. The har ¿°dONLNdÜ[ír)ìdwarXİdONLNdÜrí‘)e translates these addr˜`°dONLNd4Ü‘íÏ)besses °dONLNd:ílûΔ(õlinto the NuBus addr`°dONLNdMí«û)[ess range $F900 p‡°dONLNd]íû1)G0000 thr…†°dONLNdeí1û})#ough $F90F FFFFİdONLNdtí}û)L.°dONLNdv§l∞r(≠lTµ¿°dONLNdw§q∞ì)able 3-1√@°dONLNd§ì∞Ÿ)" shows the addr5°dONLNdé§⁄∞a)G!ess allocations for each slot ID.
  7384. ”*€¯4‘*€¯ ◊l◊¯
  7385. ˇ·ˇ‚7^
  7386.     °dONLNdˇˇ(—l    Table 3-1°dONLNd∞…™‘)>Slot allocations by slot ID°dONLNdÕfilÈ|(ÊlSlot°dONLNd“fiêÈ≈)$
  7387. 24-bit minor °dONLNd‡fi‰È)T 32-bit minor°dONLNdÌfiDÈj)`Standard°dONLNdˆfi§ÈΩ)`Super°dONLNd˝ÈlÙt(ÒlID°dONLNdÈêÙº)$
  7388. slot space°dONLNd ȉÙ)T
  7389. slot space°dONLNdÈDÙp)`
  7390. slot space°dONLNd!ȧٖ)`
  7391. slot space
  7392. °dONLNd-˙lv(l$9°dONLNd0˙ë∑)%$9x xxxx°dONLNd9˙‰)S
  7393. $F90x xxxx°dONLNdD˙Du)`
  7394. $F9xx xxxx°dONLNdO˙§‘)`
  7395. $9xxx xxxx°dONLNd[ lx(l$A°dONLNd^ ë∫)%$Ax xxxx°dONLNdg ‰Ó)S$FQ¿°dONLNdi Ó)
  7396. A0x xxxx°dONLNdr DN)V$FQ¿°dONLNdt Nw)
  7397. Axx xxxx°dONLNd} §◊)V
  7398. $Axxx xxxx°dONLNdâl*w('l$B°dONLNdåë*∏)%$Bx xxxx°dONLNdï‰*)S
  7399. $FB0x xxxx°dONLNd†D*v)`
  7400. $FBxx xxxx°dONLNd´§*’)`
  7401. $Bxxx xxxx°dONLNd∑0l<x(9l$C°dONLNd∫0ë<π)%$Cx xxxx°dONLNd√0‰<)S
  7402. $FC0x xxxx°dONLNdŒ0D<w)`
  7403. $FCxx xxxx°dONLNdŸ0§<÷)`
  7404. $Cxxx xxxx°dONLNdÂBlNx(Kl$D°dONLNdËBëN∫)%$Dx xxxx°dONLNdÒB‰N)S
  7405. $FD0x xxxx°dONLNd¸BDNw)`
  7406. $FDxx xxxx°dONLNdB§N◊)`
  7407. $Dxxx xxxx°dONLNdTl`w(]l$E°dONLNdTë`∏)%$Ex xxxx°dONLNdT‰`)S
  7408. $FE0x xxxx°dONLNd*TD`v)`
  7409. $FExx xxxx°dONLNd5T§`’)`
  7410. $Exxx xxxx
  7411. Ö*ã¯4Ü*㯠Ülܯ
  7412. ˇ·ˇ‚7^
  7413. ˇˇ◊ˇ◊°dONLNd@tlÖ®(ÅlFirmwar¬p°dONLNdGt®ÖØ)<eˇˇˇˇˇˇ®(Å3
  7414. °dONLNdIãlóÖ(îlThe fi»Ä°dONLNdOãÖó£)rmwar´ °dONLNdTã£ó)e of a NuBus expansion car€@°dONLNdnãóµ)x#d contains information that identifiœ`°dONLNdíã∂ófl)õ
  7415. es the carˆ°dONLNdúãflóÁ))d °dONLNdûól£ (†l%and its functions, and allows the carz °dONLNd√ó £ø)ü&d to communicate with the Slot Manager˝¿°dONLNdÈóæ£ˆ)≥. It may also °dONLNd˜£lØø(¨lPinclude other information, such as initialization code or code for drivers that °dONLNdGØlª* #communicate with devices on the carb`°dONLNdjت—)§*d. The sole purpose of many Slot Manager rÕ`°dONLNdîØ—ªÛ)¡outines °dONLNdúªl«ä(ƒlis to pr$`°dONLNd§ªã«Ë)ovide access to this fi/¿°dONLNdªªË«)]rmwar`°dONLNd¿ª«G)e information. °dONLNd–ÕlŸÍ(÷lThis section discusses the strÙİdONLNdÓÕÍŸ)~ucturz`°dONLNdÛÕŸm)e of the information in fiφ°dONLNd
  7416. ÕmŸã)krmwarœ@°dONLNdÕãŸî)e. k@°dONLNdÕïŸõ)
  7417. Y+¿°dONLNdÕõŸ‘)ou’ll need to °dONLNd$ŸlÂΩ(‚lunderstand the strÿ`°dONLNd6ŸΩ‘)Quctur^@°dONLNd;Ÿ’ÂF)e of this information in orZ°dONLNdVŸFÂ≈)qder to use the Slot Manager r °dONLNdsŸΔÂÙ)Ä outines. If °dONLNdÂlÒΔ(Ólyou plan to design fiwİdONLNdî«ÒÂ)[rmwarZ °dONLNdôÂÂÒ÷)7e, you will want to supplement the information in this °dONLNd–Òl˝˜(˙l section with the information in é °dONLNdÒ˜˝◊)ã4Designing Cards and Drivers for the Macintosh Family≈@°dONLNd$Ò÷˝ÿ)fl.°dONLNd&l"( l)The physical location of an expansion car^ °dONLNdO"7)∂d’s fi
  7418. ‡°dONLNdU8V)rmwarÌİdONLNdZUè)e is called its j†°dONLNdjê·);declaration ROM. ¿°dONLNdz‚˜)R The °dONLNdlr(lfiå¿°dONLNdÅrê)rmwaro`°dONLNdÜê∑)
  7419. e in a car®°dONLNdê∑Ä)',d’s declaration ROM includes these elements:,
  7420.  
  7421. Zapf Dingbats
  7422. °dONLNdΩ$l+q(*ln
  7423. °dONLNdø!x-ã) The ª¿°dONLNd√!ã-»)
  7424. format block.‘`°dONLNd–!»-ñ)=. The format block allows the Slot Manager to fiµ†°dONLNdˇ!ó-È)œnd the declaration °dONLNd-x9L(6x0ROM and to validate it. It contains some identifi%İdONLNdC-M9À)’cation information and an of°dONLNd_-À9Ë)~fset to °dONLNdg9xE´(Bx the sResour†°dONLNdr9¨Eƒ)4ce dir솰dONLNdx9ƒEfl)ectoryÎ`°dONLNd~9fiE‡).
  7425. °dONLNdÄNlUq(Tln
  7426. °dONLNdÇKxWã) The ª¿°dONLNdÜKãW‰)sResource directoryÅ`°dONLNdôK‰WÊ)Y.`°dONLNdöKÁW )  The sResour`°dONLNd¶KW7)8ce dirs`°dONLNd¨K8W∫)!ectory is a list that contains of>İdONLNdÕKªWı)Éfsets to all of °dONLNd›Wxc´(`x the sResour†°dONLNdËW¨cŸ)4 ce data str†°dONLNdÛWŸc)-ucturåİdONLNd¯Wc$)
  7427. es in the carflİdONLNdW$c9)4d’s fiå@°dONLNd W:cX)rmwarn‡°dONLNdWXc_)e.
  7428. °dONLNdllsq(rln
  7429. °dONLNdixuã) The ª¿°dONLNdiãuπ)    sResource” °dONLNd"iπu‹).     data strè@°dONLNd+i›uÙ)$uctur °dONLNd0iıu˛)es¿°dONLNd2i˛u)    .õ¿°dONLNd3iu) Ω`°dONLNd4iu    )A¯°dONLNd5i    uO) typical sResour?‡°dONLNdEiPu})G ce data str5‡°dONLNdPi}uî)-ucturª¿°dONLNdUiîu¬) e contains °dONLNd`uxÅ©(~xFinformation about a single function or capability of the expansion car¬‡°dONLNd¶u©Åfi(~© d, although °dONLNd≤Åxçµ(äx some sResourÉ`°dONLNdæŵç‚)= ce data stry`°dONLNd…Å‚ç˘)-ucturˇ@°dONLNdŒÅ˘çÚ)7es may contain other data—for example, device drivers, °dONLNd    çxôÙ(ñxicons, fonts, code, or vendor¡`°dONLNd    "çÙô)|-specifiÉ`°dONLNd    *çôT) c information. °dONLNd    :ül´ï(®l    Every carB†°dONLNd    Cüñ´Û)*d must have a single ≤°dONLNd    XüÛ´>)]Board sResourceÉ`°dONLNd    gü?´b)L     data str?İdONLNd    püc´z)$uctur≈`°dONLNd    uüz´…)e, which contains °dONLNd    á´l∑‹(¥linformation about the car†°dONLNd    †´›∑)qd as a whole. fi‡°dONLNd    Æ´∑K);
  7430. An sResour*¿°dONLNd    ∏´L∑y)4 ce data str ¿°dONLNd    √´y∑ê)-uctur¶†°dONLNd    »´ê∑õ)e rµ@°dONLNd    À´õ∑Í) elating to a specifiòİdONLNd    fl´Î∑Ò)Pc ˇ,é@ˇ ˇˇˇˇ@
  7431. ˇ·ˇ‚7^
  7432. 4H\, Palatino
  7433. .+ä"CHAPTER €`)\3,     Helvetica
  7434.     (@äThe Slot Manager4⁄ä˙(‡äIntroduction to Slots and Cards
  7435. 
  7436. ‡(‡3ù)-‡)7
  7437. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿
  7438. °dONLNd\ähfl(eäfunction is called a ⁄°dONLNd\flhA)Ufunctional sResource,#@°dONLNd*\Bhl)c
  7439.  and a car≈†°dONLNd4\lh˘)*d may have as many of them as °dONLNdRhät¥(qä    necessary4‡°dONLNd[h¥tπ)*. °dONLNd^zäÜQ(Éä.The next few sections discusses these data str5°dONLNdåzRÜi)»uctur∫‡°dONLNdëziÜë)    es in morâ¿°dONLNdözíÜ¥))    e detail.
  7440. §H´4•H´ ¶ä¶
  7441. ˇ·ˇ‚7^
  7442. °dONLNd§ó䕉(°äThe format blockˇˇˇˇˇˇ(°3
  7443. °dONLNdµ´ä∑˝(¥äThe format block always r√İdONLNdŒ´˝∑m)sesides at the highest addrT`°dONLNdË´n∑∫)qess in the standar‡†°dONLNd˙´∫∑)Ld slot space of a °dONLNd ∑ä√Á(¿äLdeclaration ROM. It contains information about the declaration ROM and an ofçİdONLNdX∑Á√(¿Á fset to the °dONLNdd√äœ≠(ÃäsResour≥@°dONLNdk√≠œ≈)#ce dir6@°dONLNdq√Δœ·)ectoryé°dONLNdw√‡œ )E. The Slot Manager uses the format block to validate the declaration °dONLNdºœä€(ÿäROM and locate the sResourW°dONLNd÷œ€5)~ ce data strM°dONLNd·œ5€L)-uctur“‡°dONLNdÊœL€W)es.°dONLNdÍ·äÌf(Íä2The format block also contains a value that specifi°¿°dONLNd·fÌˇ)‹$es which of the four byte lanes the °dONLNdAÌä˘(ˆä!declaration ROM uses, called the o‡°dONLNdbÌ˘f)îvalid byte lanes° °dONLNdrÌf˘    )H#. Some declaration ROMs do not use °dONLNdï˘ä(äall four byte lanes and therİdONLNd±˘)wefor^İdONLNdµ˘Ä)e the system cannot addr∂°dONLNdÕ˘Ä)ness every memory location in °dONLNdÍä∂(ä
  7444. their addr¥‡°dONLNdÙ∂‡),
  7445. ess space.°dONLNdˇä#j( ä4Designing Cards and Drivers for the Macintosh Family“‡°dONLNd3j#})‡ defiE°dONLNd8~#´) nes the strX`°dONLNdC´#¬)-ucturfi@°dONLNdH¬#)e of the format °dONLNdX#ä/(,ä7block and gives examples of how the valid byte lanes afİdONLNdè#Ä/¯)ˆfect communication with a °dONLNd©/ä;ÿ(8ädeclaration ROM.
  7446. YH`4ZH` [ä[
  7447. ˇ·ˇ‚7^
  7448. °dONLNd∫LäZÀ* The sResour“°dONLNd≈LÀZË)Ace dir<°dONLNdÀLÈZ    )ectoryˇˇˇˇˇˇ(V3
  7449. °dONLNd“`äl¿(iä The sResourÔ°dONLNd›`¿lÿ)6ce dirr°dONLNd„`ŸlL)ectory lists all the sResourT°dONLNdˇ`Lly)s ce data strJ°dONLNd
  7450. `ylê)-ucturœ‡°dONLNd`êlƒ)
  7451. es in the car"‡°dONLNd`≈l”)5d fiÀ`°dONLNd `”lÒ)rmwarưdONLNd%`Òl )e and °dONLNd+läxì(uäprG °dONLNd-lîx…)
  7452. ovides an of⁄¿°dONLNd9l…x)5fset to each one.°dONLNdK~ää¢(áäFigurR¿°dONLNdP~¢ä∂)e 3-3@°dONLNdU~∂äF)  shows the format of the sResour뇰dONLNdu~Gä_)ëce dir‡°dONLNd{~`ä{)ectoryl†°dONLNdÅ~zä|).
  7453. ≠Hæ4ÆHæ"ÆH_
  7454. ˇ·ˇ‚7^
  7455.     °dONLNdˇˇ(´ä
  7456. Figure 3-3°dONLNdÉ£ÃÆfi)BThe Å °dONLNdá£fiÆS)sResource directory structure
  7457. °dONLNd•Qä](ZäEach element of the sResour‰`°dONLNd¿Q])|ce dirg`°dONLNdΔQ]´) ectory contains an 8-bit sResour÷°dONLNdÊQ´])åce ID followed by a 24-°dONLNd˝]äi†(fäbit ofN °dONLNd]°i»)
  7458. fset. The &¿°dONLNd
  7459. ]…i)(
  7460. sResource ID u†°dONLNd]i')?identifiL@°dONLNd"](ig) es the sResourcİdONLNd0]giî)? ce data strYİdONLNd;]îi´)-ucturfl`°dONLNd@]´i)e. Each sResourπ†°dONLNdO]i)Ece data °dONLNdWiäuï(rästrfi°dONLNdZiïu¨) ucturc‡°dONLNd_i≠u›) e in the cary‡°dONLNdki›uÎ)0d fi"`°dONLNdoiÏu
  7461. )rmwar°dONLNdti
  7462. u\)e has a unique ID. ≈ °dONLNdái[u|)QApple rᆰdONLNdéi}u)" eserves ID numbers in the range °dONLNdÆuäÅË(~ä$00 – $EF for sResour °dONLNd√uÈÅ)_ ce data str °dONLNdŒuÅ-)-ucturñ°dONLNd”u-ÅI)es defi¿°dONLNd⁄uJÅ„)#ned for all declaration ROMs; at pr∫ °dONLNd˝u„Å)ô
  7463. esent ther¿Ä°dONLNduÅ)+e °dONLNd    Åäç(ääis only one of these: sResourT‡°dONLNd&Åçò)}!ce ID $01, which indicates a BoarJ@°dONLNdGÅòç√)ë    d sResour@°dONLNdPŃç),ce. The sResour¬ °dONLNd_Åç)Dce °dONLNdbçäô!(ñä ID numbers appear in the sResour‘°dONLNdÇç!ô9)óce dirW°dONLNdàç:ôõ)ectory in ascending orΆ°dONLNdûçõô©)ader@°dONLNd°ç™ô¨).°dONLNd£üä´¿(®ä The sResourÔ°dONLNdÆü¿´s)6)ce ID $FF indicates an end-of-list markerx°dONLNd◊üs´x)≥. 
  7464. Ωä94æä9
  7465. æä9à4Ωâæäò Â˛Â˛æä°à··˝7ÉÉ0¸Ê¿0fÙ˝6Δ0¸=Ä1ÄfÙ˝6œª¸?˚ª˛~Ù˝6«ˇ∞¸=˜ÒøvÙ˝6«„∞¸=˛1∏vÙ˝7áø¸ÌÛ˘ø~Ù····
  7466. Ïˇ˛˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚    ͡‡˚Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙Ρ˙······························ ∞‡c¡¸ Ä>¸
  7467. Ù ¿íà¸Ù Aĸ    @˝!)A<"3åÀl0;lΔ{7êÔºçÚŸÄˇ!*BʼnH    <TíI¥PI5J$öë$‘îíjġ!*∫ Å$H    —(í"I êâ"P(êêÑцíDġ "LÇ Ç0D·"í ‡íCêH††I    !$á˛!"LÇI
  7468.      Bî§∂$ê∂¬RY a+ emÑġ \È¡é p8 „gZ`[Aåf AÕôñɲ
  7469. ˘àÛ@˘ ˘àÙĢ
  7470. ˘pÙ¯·‡0‡˝ÓÏ8 ¿˝DD0 @˝DDPFx)M–”Õ∞àäPI *Ri$î–àäêQ *¢J$§Äàä†"ë@L§íC9# "≤PL≠ñ“%! \Ã`È÷ôgq;∫p˘ÄÏ˘ÄÏ˘Í··············@¸pÔĸ Ô
  7471. Ä Ôi¢§”/mÄZ    4“( $⁄i$¶ÄM($íH DíI%$I@Ep E$äI»í@!I%H"I%í€(í»sÒΔ01&·l»!”0˛Ç˝˛ Ó˛Ç˝˛@Ó «˝Äη
  7472. ÄÓüp∞Ô
  7473. DàÇ êÔHÇ@ê@Úê›Ìôh    ,ùˆo≥`Ù·&µ    4†    $§öíI†Ù¢$"    $@    $êëâÛ"HB íHÄI    !$äÛ"
  7474. ÿD VÀ €eamíÛ\CùhDp\ÎM‰;eπ†∂bۈ̷̈· ∞¸`0Ï ê¸êHÏ
  7475. ê@àÏ
  7476.     &O˚oô∞ àÏ
  7477.     "Rçí$–¡Ï
  7478.     "HâDÄ!Ï
  7479. DÖ$E!Ï
  7480. ’≥QmIA Ï
  7481. ;b›ê∂1ѿϷ··ò Â˛Â˛æä°à··˝7ÉÉ0¸Ê¿0fÙ˝6Δ0¸=Ä1ÄfÙ˝6œª¸?˚ª˛~Ù˝6«ˇ∞¸=˜ÒøvÙ˝6«„∞¸=˛1∏vÙ˝7áø¸ÌÛ˘ø~Ù····
  7482. Ïˇ˛˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¿˚a ˚˙     ˚í@˚˙…6e ¸˘∏˚˙Ó|ï$¸
  7483. –˚˙©lÖ*˚ív˚˙…4u ˚bYÿ˚˙˝Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙Ρ˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¿˚a ˚˙     ˚í@˚˙…6e ¸˘∏˚˙Ó|ï ¸
  7484. –˚˙©lÖ,˚ív˚˙…4uƒ˚bYÿ˚˙˝Ú˙˝Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙Ρ˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙˙¿˙˙˚‡˙˙Ä˚‡˙˙˙‡˙˙¸Ú˙¸Ú˙¸Ú˙¸Ú‡˚˙¿˘`˚Ä˚‡˘¿˚Ä˚‡˙¿˚˙¿˙Ä˚¸Ú˙¸Ú˙8¸Ú˙p¸Ú ˙`˙‡˙˙¯Ä˚‡˙˙˚‡˙˙˙¿˙˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙Ρ˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¿˚a ˚˙     ˚í@˚˙…6e ¸˘∏˚˙Ó|ï ¸
  7485. –˚˙©lÖ,˚ív˚˙…4u ˚bYÿ˚˙˝
  7486. Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙Ρ˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙¸Ú˙wº¸9ò3ĸ˙¨ ¸VdL¶@¸˙d ¸2dL¶@¸˙?º¸dL¶@¸˙¨ ¸VdL¶@¸˙t ¸9ò3ĸ˙ ¸¯˙¸Ú˙¸Ú˙¸Ú˙Ρ˙Ρ˙······························ ∞‡c¡¸ Ä>¸
  7487. Ù ¿íà¸Ù Aĸ    @˝!)A<"3åÀl0;lΔ{7êÔºçÚŸÄˇ!*BʼnH    <TíI¥PI5J$öë$‘îíjġ!*∫ Å$H    —(í"I êâ"P(êêÑцíDġ "LÇ Ç0D·"í ‡íCêH††I    !$á˛!"LÇI
  7488.      Bî§∂$ê∂¬RY a+ emÑġ \È¡é p8 „gZ`[Aåf AÕôñɲ
  7489. ˘àÛ@˘ ˘àÙĢ
  7490. ˘pÙ¯·‡0‡˝ÓÏ8 ¿˝DD0 @˝DDPFx)M–”Õ∞àäPI *Ri$î–àäêQ *¢J$§Äàä†"ë@L§íC9# "≤PL≠ñ“%! \Ã`È÷ôgq;∫p˘ÄÏ˘ÄÏ˘Í··············@¸pÔĸ Ô
  7491. Ä Ôi¢§”/mÄZ    4“( $⁄i$¶ÄM($íH DíI%$I@Ep E$äI»í@!I%H"I%í€(í»sÒΔ01&·l»!”0˛Ç˝˛ Ó˛Ç˝˛@Ó «˝Äη
  7492. ÄÓüp∞Ô
  7493. DàÇ êÔHÇ@ê@Úê›Ìôh    ,ùˆo≥`Ù·&µ    4†    $§öíI†Ù¢$"    $@    $êëâÛ"HB íHÄI    !$äÛ"
  7494. ÿD VÀ €eamíÛ\CùhDp\ÎM‰;eπ†∂bۈ̷̈· ∞¸`0Ï ê¸êHÏ
  7495. ê@àÏ
  7496.     &O˚oô∞ àÏ
  7497.     "Rçí$–¡Ï
  7498.     "HâDÄ!Ï
  7499. DÖ$E!Ï
  7500. ’≥QmIA Ï
  7501. ;b›ê∂1ѿϷ··ˇ.v@ˇ ˇˇˇˇ@
  7502. ˇ·ˇ‚7^
  7503. 4*\˜, Palatino
  7504. .+l"CHAPTER €`)\3,     Helvetica
  7505.     (@lThe Slot Manager4⁄*˙¯
  7506. (‡*3 )-c)8
  7507.     )9Introduction to Slots and Cards
  7508. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  7509. °dONLNd\lhà(elThe ofWİdONLNd\àh†)fset fiÅ °dONLNd
  7510. \†h)) eld of each entry contains an of‡°dONLNd-\)hÏ)â.fset (counting only bytes accessible by valid °dONLNd[hlt›(qlbyte lanes) to the sResourİdONLNduh›t
  7511. )q ce data struİdONLNdÄh
  7512. t!)-uctur˚`°dONLNdÖh!tD)e. The fi
  7513. İdONLNdéhEt^)$nal of„°dONLNdîh]tu)fset fi †°dONLNdõhvtÏ)eld must have a value of 0.
  7514. í*ô¯4ì*ô¯ îlî¯
  7515. ˇ·ˇ‚7^
  7516. °dONLNd∑Ölìñ(èlsResourΩİdONLNdæÖñìœ)* ce Data Str›°dONLNd…ÖœìÎ)9uctur@°dONLNdŒÖÏìˆ)esˇˇˇˇˇˇ(èÚ3
  7517. °dONLNd—ôl•´(¢l
  7518. Every sResour@†°dONLNdfiô¨•Ÿ)@ ce data str6†°dONLNdÈôŸ•)-ucturºÄ°dONLNdÓô•7)e contains of an  °dONLNdˇô8•w)HsResource list`°dONLNd
  7519. ôw•È)?. Each entry of an sResourû‡°dONLNd'ôÈ•Ú)rceÿ¿°dONLNd)ôÚ•Ù)     °dONLNd*•l±*(Æl+list contains information about the sResourS°dONLNdU•*±ô)æce or contains a signed ofl@°dONLNdo•ô±)ofset to another data °dONLNdѱlΩw(∫lstrfi°dONLNdá±wΩé) ucturc‡°dONLNdå±èΩ–)Je, which might contain icons, code, device drivers, or other information r, °dONLNd÷±—ΩÒ(∫—elating °dONLNdfiΩl…™(Δlto the sResourHİdONLNdÏΩ´…π)?ce. °dONLNdÒœl€¢(ÿl The sResourÔ°dONLNd¸œ¢€œ)6 ce data str°dONLNdœœ€Ê)-ucturj‡°dONLNd œÁ€])e is made up of its sResourć°dONLNd'œ]€‡)v ce list and all the information °dONLNdG€lÁ›(‰lpointed to by the sResour∏`°dONLNd`€›Á)qce list entries.
  7520. Ù*¯4ı*¯
  7521. °dONLNdˇˇ(¸lNOTE
  7522. ˇ·ˇ‚7^
  7523. °dONLNdq˛l
  7524. ü*
  7525. An sResourÀ‡°dONLNd{˛ü
  7526. Ã)3 ce data str¡‡°dONLNdܲÃ
  7527. „)-ucturG¿°dONLNdã˛‰
  7528. *)e is sometimes r—@°dONLNdõ˛*
  7529. >)Feferrp°dONLNd†˛?
  7530. j) ed to as a J@°dONLNd´˛k
  7531. ),slot rÔ@°dONLNd±˛
  7532. î)esourk‡°dONLNd∂˛ï
  7533. ú)cea`°dONLNd∏˛ù
  7534. ¢). °dONLNd∫
  7535. l≠(l
  7536. Note, however]°dONLNd«
  7537. ≠„)A, that a slot r’`°dONLNd÷
  7538. „˚)6esour†°dONLNd€
  7539. ¸:)ce is a data str9°dONLNdÎ
  7540. :Q)>uctur懰dONLNd
  7541. Qy)
  7542. e in the fi¨`°dONLNd˚
  7543. zò))rmwarè°dONLNd
  7544. òü)e °dONLNdl"≠(lof a NuBus car¥Ä°dONLNd≠"7)Ad and not a type of Macintosh rW¿°dONLNd/8"P)ãesour†°dONLNd4P"^)ce. ,
  7545.  
  7546. Zapf Dingbats
  7547. Ÿ‡°dONLNdˇˇ)u
  7548. °dONLNdM(l4¢(1l The sResourÔ°dONLNdX(¢4»)6 ce list str◊°dONLNdc(…4‡)'uctur\‡°dONLNdh(·4R)e is similar to the sResourQ °dONLNdÉ(R4j)qce dir‘ °dONLNdâ(j4ì)
  7549. ectory str%†°dONLNdì(î4´)*uctur´Ä°dONLNdò(´4Ã)e. Each °dONLNd†4l@è(=lsResour≥@°dONLNdß4è@
  7550. )#ce list entry has an 8-bit ID fi*‡°dONLNd«4@^)eld, which identifi°†°dONLNd⁄4^@√)Pes the type of the entryç°dONLNdÚ4¬@Ô)d , and a 24-°dONLNd˝@lLÇ(Ilbit ofN °dONLNd@ÉLõ)fset fiw¿°dONLNd
  7551. @õLZ),eld, which can contain a byte of data, a worËİdONLNd6@ZL®)ød of data, or an of°dONLNdI@©LŸ)O
  7552. fset to a larÉ °dONLNdV@ŸLÈ)0ger °dONLNdZLlX√(Ulblock of data. The fi‘‡°dONLNdoL√X))Wnal entry in an sResour¨ °dONLNdÜL)XÊ)f+ce must contain the value $FF in the type fi‡°dONLNd≤LÁX˜)æeld °dONLNd∂XldÈ(aland the value 0 in the data fi+‡°dONLNd‘XÍd˙)~eld.°dONLNdŸjlvÑ(slFigurR¿°dONLNdfijÑvò)e 3-3@°dONLNd„jòv%) shows the format of an sResourÖ‡°dONLNdj&vA)éce list.
  7553. ö*´¯4ö*™¯"ö*_
  7554. ˇ·ˇ‚7^
  7555.     °dONLNdˇˇ(ól
  7556. Figure 3-4°dONLNd èÆö )BsResource list structure
  7557. °dONLNd$?lKí(HlThe ID fid@°dONLNd-?ìKñ)'=eld of each entry indicates the type of information in the ofè °dONLNdj?ñKÆ(Hñfset fi∏¿°dONLNdq?ÆKÒ)eld of the entry†°dONLNdÅ?Kı)B. °dONLNdÉKlWç(TlApple rBİdONLNdäKéWd)".eserves the range $00 – $7E for common sResourå°dONLNd∏KdW¶)÷ce entry types. ˇ@°dONLNd»K¶WÌ)BDesigning Cards °dONLNdÿWlc(`l$and Drivers for the Macintosh Family¥†°dONLNd¸Wc)ô gives a complete list of the k`°dONLNdWcÆ)z    Apple-defi.‡°dONLNd$WØcÂ)0 ned sResourò‡°dONLNd/WÂc)6ce °dONLNd2cloÂ(lllist IDs and their meanings.°dONLNdOulÅà*The ofWİdONLNdUuàņ)fset fiÅ °dONLNd\u†Å')eld of each entry in an sResourA°dONLNd{u(ÅÂ)à.ce list can contain data or it can contain an °dONLNd©Ålçt(älof¿°dONLNd´Åuç◊)    fset to a block of data. ¸‡°dONLNdƒÅ◊çÚ)bThis fi° °dONLNdÀÅÛçG)eld takes one of thr˘†°dONLNdflÅGçï)Tee possible forms:
  7558. °dONLNdÚñlùq(úln
  7559. °dONLNdÙìxüã) ?It may contain two $00 bytes followed by an 8-bit byte of data.
  7560. °dONLNd4®lØq(Æln
  7561. °dONLNd6•x±U) 2It may contain a $00 byte followed by a 16-bit worTİdONLNdh•U±~)›
  7562. d of data.
  7563. ™l(¯4™l'¯
  7564. ™l(M4©k™lò‡·‡·™làM„„˝7ÉÉ0¸Ê¿0fˆ˝6Δ0¸=Ä1Äfˆ˝6œª¸?˚ª˛~ˆ˝6«ˇ∞¸=˜Òøvˆ˝6«„∞¸=˛1∏vˆ˝7áø¸ÌÛ˘ø~ˆ„„„„
  7565. Ïˇ˛¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝    ͡‡˝Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸Ρ¸„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„ ∞‡`¡¸ Ä>¸hˆ ¿ìàĸ ˆ Aĸ Ä˚)A<"3åÀl0X˛˜#>[0˝*BʼnH    <TíI¥PI(%%MP˝*∫(Å$H    ƒ(í"I êHà(Hê˝"LÇ(Ç0D·"í ‡êP
  7566. "H$ê‡˝"LÇI
  7567.      Bî§∂$êµ4&¢Ÿ-∞ê˝\È¡Ü p8„gZ`Ÿÿ;!f2–`˝˘àÏ˘àÏ˘pχ0‡˝ÓÏ8Ú ¿˝DD0Ú @˝DDPÚFx)M–”Õ∞àäPÚI *Ri$î–àäêÚQ *¢J$§Äàä†Ú"ë@L§íC9# Ú"≤PL≠ñ“%! Ú\Ã`È÷ôgq;∫pÚ˘ÄÓ˘ÄÓ˘Ï„„„„„„„„„„„„@¸pÒĸ Ò
  7568. Ä Òi¢§”/mÄZÚ    4“( $⁄i$¶ÄM(Ú$íH DíI%$I@ÚEp E$äI»í@Ú!I%H"I%í€(í»ÚsÒΔ01&·l»!”0ڲǽ˛ ˛Ç˝˛@ «˝ÄÌ
  7569. ÄÓüp∞Ò
  7570. DàÇ êÒHÇ@ê@Ùê›Ìôh    ,ùˆo≥`ˆ·&µ    4†    $§öíI†ˆ¢$"    $@    $êëâı"HB íHÄI    !$äı"
  7571. ÿD VÀ €eamíı\CùhDp\ÎM‰;eπ†∂bıˆÔˆÔ„ ∞¸`0Ó ê¸êHÓ
  7572. ê@àÓ
  7573.     &O˚oô∞ àÓ
  7574.     "Rçí$–¡Ó
  7575.     "HâDÄ!Ó
  7576. DÖ$E!Ó
  7577. ’≥QmIA Ó
  7578. ;b›ê∂1ѿӄ„„ò‡·‡·™làM„„˝7ÉÉ0¸Ê¿0fˆ˝6Δ0¸=Ä1Äfˆ˝6œª¸?˚ª˛~ˆ˝6«ˇ∞¸=˜Òøvˆ˝6«„∞¸=˛1∏vˆ˝7áø¸ÌÛ˘ø~ˆ„„„„
  7579. Ïˇ˛¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¿˚a ˚¸ @˚í@˚¸&ÃWΔ¸˘∏˚¸=œíU/¸
  7580. –˚¸5-êU(˚ív˚¸&éI«˚bYÿ˚¸˛    Ú¸˛Ú¸˛Ú¸¸Ú¸¸Ú¸Ρ¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸@˚a ˚¸Ä@˚í@˚¸dõ5]°Ñ¸˘∏˚¸˜>MGSƒ¸
  7581. –˚¸‘∂D€R˚ív˚¸dö<OQƒ˚bYÿ˚¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸Ρ¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸0 Ú¸    0 ˚a ˚¸¸ÃwÃ˚í@˚¸≥Ë5>¸˘∏˚¸    350¸
  7582. –˚¸2Ë9Œ˚ív˚¸˛    ˚bYÿ˚¸˛Ú¸˛Ú¸¸Ú¸¸Ú¸¸Ú¸Ρ¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸˙¿˙¸˚‡˙¸Ä˚‡˙¸˙‡˙¸¸Ú¸¸Ú¸¸Ú‡˝¸Ò`˝˙¿˘‡˝Ä˚‡˙¿˝Ä˚‡˙Ä˝ ˙¿˙Ä˝¸Ú¸8¸Ú¸0¸Ú¸`¸Ú¸‡˙‡˙¸¯Ä˚‡˙¸˚‡˙¸˙¿˙¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸Ρ¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸¸Ú¸œÚ¸®Ä¸9ò3ĸ¸àĸVdL¶@¸¸Ô¸2dL¶@¸¸®Ä¸dL¶@¸¸»Ä¸VdL¶@¸¸Ä¸9ò3ĸ¸¸¸¯¸¸Ú¸¸Ú¸¸Ú¸Ρ¸Ρ¸„„„„„„„„„„„„„„„„„„„„„„„„„„„„„„ ∞‡`¡¸ Ä>¸hˆ ¿ìàĸ ˆ Aĸ Ä˚)A<"3åÀl0X˛˜#>[0˝*BʼnH    <TíI¥PI(%%MP˝*∫(Å$H    ƒ(í"I êHà(Hê˝"LÇ(Ç0D·"í ‡êP
  7583. "H$ê‡˝"LÇI
  7584.      Bî§∂$êµ4&¢Ÿ-∞ê˝\È¡Ü p8„gZ`Ÿÿ;!f2–`˝˘àÏ˘àÏ˘pχ0‡˝ÓÏ8Ú ¿˝DD0Ú @˝DDPÚFx)M–”Õ∞àäPÚI *Ri$î–àäêÚQ *¢J$§Äàä†Ú"ë@L§íC9# Ú"≤PL≠ñ“%! Ú\Ã`È÷ôgq;∫pÚ˘ÄÓ˘ÄÓ˘Ï„„„„„„„„„„„„@¸pÒĸ Ò
  7585. Ä Òi¢§”/mÄZÚ    4“( $⁄i$¶ÄM(Ú$íH DíI%$I@ÚEp E$äI»í@Ú!I%H"I%í€(í»ÚsÒΔ01&·l»!”0ڲǽ˛ ˛Ç˝˛@ «˝ÄÌ
  7586. ÄÓüp∞Ò
  7587. DàÇ êÒHÇ@ê@Ùê›Ìôh    ,ùˆo≥`ˆ·&µ    4†    $§öíI†ˆ¢$"    $@    $êëâı"HB íHÄI    !$äı"
  7588. ÿD VÀ €eamíı\CùhDp\ÎM‰;eπ†∂bıˆÔˆÔ„ ∞¸`0Ó ê¸êHÓ
  7589. ê@àÓ
  7590.     &O˚oô∞ àÓ
  7591.     "Rçí$–¡Ó
  7592.     "HâDÄ!Ó
  7593. DÖ$E!Ó
  7594. ’≥QmIA Ó
  7595. ;b›ê∂1ѿӄ„„ˇ,¬@ˇ ˇˇˇˇ@
  7596. ˇ·ˇ‚7^
  7597. 4H\, Palatino
  7598. .+ä"CHAPTER €`)\3,     Helvetica
  7599.     (@äThe Slot Manager4⁄ä˙(‡äIntroduction to Slots and Cards
  7600. 
  7601. ‡(‡3ù)-‡)9
  7602. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿,
  7603.  
  7604. Zapf Dingbats
  7605. °dONLNd_äfè(eän
  7606. °dONLNd\ñh) It may contain a 24-bit ofY@°dONLNd\h-)n fset to lar[`°dONLNd'\-h_)) ger data strb‡°dONLNd3\_hv)2ucturË¿°dONLNd8\vhÅ)es °dONLNd<täÄê(}äTµ¿°dONLNd=tèı)able 3-2√@°dONLNdEt±Ä„)" lists the lar[ °dONLNdSt‰Ä)3 ger data strb†°dONLNd_tÄ-)2ucturËİdONLNddt-Ä∞)es commonly used in sResourQ¿°dONLNdt±Äfi)Ñ ce data strG¿°dONLNdätfiÄı)-ucturÕ†°dONLNdètıÄ)es.
  7607. £H´4§H´ ßäß
  7608. ˇ·ˇ‚7^
  7609.     °dONLNdˇˇ(°ä    Table 3-2°dONLNdìô»§˙)> Larger Data X‡°dONLNdüô˙§ˇ)2TY∞°dONLNd†ôˇ§)ypes°dONLNd¶±äº•(πäData TT∞°dONLNd¨±•º¥)ype°dONLNd∞±Óº)I Description,
  7610. Courier
  7611. .°dONLNdΩøäÀ¢(»äLong.°dONLNd¬øÓÀg)d32 bits, signed or unsigned..°dONLNd‡—䛥(⁄äPointer.°dONLNdË—Ó›g)d32 bits, signed or unsigned..°dONLNd„äÔ¥(ÏäcString.°dONLNd„ÓÔ»)d0One-dimensional array of bytes, ending with $00..°dONLNd@ıäÆ(˛äsBlock.°dONLNdGıÓı)dA∫†°dONLNdHıı`) sized block of data. See $¿°dONLNdbıay)lFigur˜Ä°dONLNdgıxå)e 3-5ï°dONLNdlıçè)..°dONLNdoäΔ(ä
  7612. SExecBlock.°dONLNdzÓı)dA∫†°dONLNd{ıa) sized block of code. See ë¿°dONLNdïbz)mFigurdİdONLNdözé)e 3-5°dONLNdüèë).ˇˇÑ∞.°dONLNd°*ä6ù(3äThe ˇ˛é∞°dONLNd•*û6¬)sBlockˇˇÑ∞∞°dONLNd´*¬6÷)$ and ˇ˛é°dONLNd∞*÷6)
  7613. SExecBlockˇˇÑ∞°dONLNd∫*67)<     data strp°dONLNd√*76M)%uctur’–°dONLNd»*L6™)es begin with a size fim@°dONLNdfl*´6)_eld, which contains the °dONLNd˜6äB](?ä0physical size of the block (including the size fi°dONLNd(6]Bâ)”
  7614. eld). The °dONLNd26âB≠),sBlock°dONLNd86≠Bª)$ strl°dONLNd<6ªB—)uctur>`°dONLNdA6—B)e follows the °dONLNdOBäN•(Käsize fi°dONLNdVB•N+)eld with its actual data. The °dONLNdtB+Ng)Ü
  7615. SExecBlock°dONLNd~BgNp)< fi°dONLNdÅBpN“)    eld follows the size fi°dONLNdòB“N)beld with some .°dONLNd¶NäZ¿(Wä additional fi܆°dONLNd≥N¿Z)6elds and code. 
  7616. }Hé4~Hé"~H_
  7617. ˇ·ˇ‚7^
  7618.     °dONLNdˇˇ({ä
  7619. Figure 3-5°dONLNd√sÃ~†)B3Format of the sBlock and SExecBlock data structures
  7620. 0H741H7 2ä2
  7621. ˇ·ˇ‚7^
  7622. °dONLNd˜#ä1¥(-äsResourΩİdONLNd˛#¥1…)*ce T@°dONLNd#…1&)ypes and sResourY¿°dONLNd#&1Y)]ce Namesˇˇˇˇˇˇ)Í3
  7623. .°dONLNd=äI·(FäThe Slot Manager rR`°dONLNd-=·I¯)Wequir$¿°dONLNd2=¯IT)es that each sResour˜ °dONLNdF=SI†)[ce list contain an ˜ °dONLNdY=†I÷)M    sRsrcType˜ °dONLNdb=÷I)6 entry€`°dONLNdh=ÔI), which °dONLNdpIäU≠(Räidentifi°dONLNdxI≠U )#es the .°dONLNdI U)sResource type. °dONLNdçIU4)E    , and an  °dONLNdñI4Uj)%    sRsrcName °dONLNdüIjUÑ)6 entry˙`°dONLNd•IÇU±)
  7624. , which prÿ°dONLNdØI±U„)/ ovides the .ÿ°dONLNd∫I„U)2
  7625. sResource °dONLNdƒUäa¢(^äname`°dONLNd»U£a•)..°dONLNd gäsû(päThe °dONLNdŒgûs‘)    sRsrcType°dONLNd◊g‘s-)6 entry contains an ofR`°dONLNdÏg-sX)Y fset to an .R`°dONLNd˜gXsw)+sRsrcTÑ`°dONLNd˝gvs¶)
  7626. ype record.놰dONLNdg¶sº)0—a rd°dONLNd gºsŒ)ecor6`°dONLNdgŒs)d containing 2 .°dONLNdsä±(|älong worO‡°dONLNd&s≤Ú)(ds that identifi’`°dONLNd6sÚ1)@es the sResourφ°dONLNdDs1R)?ce type.°dONLNdMÖäë¢(éäFigurR¿°dONLNdRÖ¢ë∂)e 3-6@°dONLNdWÖ∂ë>) shows the format of an sRrscT@°dONLNduÖ>ëT)àype r∏ °dONLNdzÖTëf)ecor,İdONLNd~Ögëo)d.
  7627. çä 4éä 
  7628. éä µ4çâéäò&Ì+Ì+éäyµ€€˙Ê¿ÚÄÏ¿˚˙∂¿Ú º¿˚˙=ÁŒ¯Úˇ˚πÌŒ¯˚˙y∑{‡ÛÏwÌø{‡˚˙=∑xÚ¸vaøx˚˙yÁœ¯ÛÔ˚˝Ìœ¯˚€€€€€ Òˇ‡ˇÄ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ Òˇˇ¿ ?Òˇˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿Ìˇ¿€€€€€€€€€€€€€€€€€€€€€€€€˛
  7629. Î<¿¿p‡˝    00ʘ
  7630.      DÄ@à ˝    P˜ @ê˛ @†˜˛Çî√¿Ä`Lfiëæ „¯`r$aíËp˜˛B§!DÄĆíkjHA$†ì‰íî    4ê˜˛"´¢ DÄù¢BLH"A% B%˜$»"  É"Ñîê"ÇI¿$(I ˜$»$@ ¢ $Ñï¥$ÇÀ î+$™Àh˜Œú@p«Ä¿ÑöÿÉL¿ÔÃ√, L∞˜ ˘ĢÄÓ ˘Ä˙ÄÓ
  7631. ˘˘Ì€
  7632. ˛ÎÃ0Ê
  7633. $Ê$Ä@Ï˛Ç9òƒH√$7⁄˜ëæ[3ÄÔ˛C )G…%(I$$öííMTÄÔ˛"DJ*(0"âDêîHíÓ$r2(P$íH    !$$ê·Ó$*JHVIT-∂⁄%al≠∞îÄÔœÛ1üôÜX[,9†≥2–gÓ€€€€˛Ó˝éÓ√ÄÎ ¸ÑDC͸ÑDEͲ ÑgÇî›
  7634. <€Hà•Ͳ Dí•&íIMHà©Í˛ %™$¢JH(à™Í) I$3ê12Í+% Ÿm"P2ÍÃΔùiñqêGªßͯà@Á¯àÄÁ¯p€€€€€€€€€€€€€€˛0t¸È˛0à¸È˛0˛ È˛ Vö!ÅöM2ˆÿ°Äβ ìM"ÇM¶íJh“ÄÎÚI$ÇI$íR@îÍQGRH§úÄ    $ÍíTÇ$íY-≤Ä    ,ÄÎ?c√nÃÇ3Ͳ ˝Ë˛ ˝Ë ˛p˝8€˛Ë‡    w˛˚È    @à"˛IÈ    Äà$˛IÌ˛Ä    
  7635. fi—Iñèí…flf˚6Ó˛@kQ‡pìJíJI©$öÓ˛ 
  7636. "B!PíDíI    (êÓ $Ñ"â$à$êíH†Ó ≠ÑBÖl≤-∂VŸ Óƒ9÷ÑGŒ¥fiC∂[ö f Óı@ËıÄË€€ ˛˚¸Ê ˛I¸    ÄÁ˛IÄÁ˛ídˇ∂˘õÄÁ˛í%(Ÿ"M ÄÁ
  7637. ˛í$àë$HÊ
  7638. $HQDPÊ
  7639. -[5‘ê$Ê
  7640. ∂-Ÿ cLÊ€€ò&Ì+Ì+éäyµ€€˙Ê¿ÚÄÏ¿˚˙∂¿Ú º¿˚˙=ÁŒ¯Úˇ˚πÌŒ¯˚˙y∑{‡ÛÏwÌø{‡˚˙=∑xÚ¸vaøx˚˙yÁœ¯ÛÔ˚˝Ìœ¯˚€€€€€ Òˇ‡ˇÄ@˝ˆ0ÄÒ¿@˝ˆ0ÄÒ¿@˝ˆ0ÄÒ¿@˝ˆ0ÄÒ¿@˝ˆ0ÄÒ¿@˝ˆ0ÄÒ¿%@9òÄ 0IJ@Ä ¸¿$
  7641. @Vd    Ä ˛0IJ    @Ä ˚¿&@2d    Âµπ1¨kÿ0IJ    u¥›ô¨kÿ˝¿&@dï~MJp¯º0IJM}'¶p¯º˝¿&@Vdïn5J(Ÿ 0IJMm¶(Ÿ ˝¿&@9òí5›1‰k‹0IJJ4Ôô‰k‹˝¿@˘0Ä˝ˆ¿@˝˘0Ä˝ˆ¿@˝ˆ0ÄÒ¿@˝ˆ0ÄÒ¿@˝ˆ0ÄÒ¿ Òˇˇ¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò
  7642. 0Ä câ Ñ˛¿@Ò0Ä     íI
  7643. DÄ¿@Ò0Ä    2¿!I
  7644. DòÕ≠ú¿@Ò0ÄzÄ!â
  7645. D=ˇ+‰¿@Ò0Ä    BÄ í    
  7646. D°±*$¿@Ò0Ä    9 b Ñúœ‹¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿@Ò0IJ ˛˘¿ @Ò0ˇ¿
  7647. @Ò0ÄÒ¿
  7648. @Ò0ÄÒ¿
  7649. @Ò0ÄÒ¿
  7650. @Ò0ÄÒ¿
  7651. @Ò0ÄÒ¿
  7652. @Ò0ÄÒ¿@˚¿@˙0ĸ    Ä¸¿@˚ @˙0ĸ$ĸ¿@˚.¯˙0ĸAé¡øÕ¿¸¿@˚#L˙0ĸBS‚S˛Ä¸¿@˚-t˙0ĸ&SS∞ĸ¿@˚«|˙0ĸé·íŒ¿¸¿
  7653. @Ò0ÄÒ¿
  7654. @Ò0ÄÒ¿
  7655. @Ò0ÄÒ¿
  7656. @Ò0ÄÒ¿
  7657. @Ò0ÄÒ¿ @Ò0ˇ¿
  7658. @Ò0ÄÒ¿
  7659. @Ò0ÄÒ¿
  7660. @Ò0ÄÒ¿
  7661. @Ò0ÄÒ¿
  7662. @Ò0ÄÒ¿
  7663. @Ò0ÄÒ¿
  7664. @Ò0ÄÒ¿
  7665. @Ò0ÄÒ¿
  7666. @Ò0ÄÒ¿
  7667. @Ò0ÄÒ¿
  7668. @Ò0ÄÒ¿
  7669. @Ò0ÄÒ¿
  7670. @Ò0ÄÒ¿
  7671. @Ò0ÄÒ¿
  7672. @Ò0ÄÒ¿
  7673. @Ò0ÄÒ¿
  7674. @Ò0ÄÒ¿
  7675. @Ò0ÄÒ¿
  7676. ÒˇÄÒ¿
  7677. ?ÒˇÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄ˚@˙¿ÌÄ˚    @˙¿ÌÄ˚1ÿ˙¿ÌÄ˚J|˙¿ÌÄ˚    J`˙¿ÌÄ˚1‹˙¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿ÌÄÒ¿Ìˇ¿Ìˇ¿€€€€€€€€€€€€€€€€€€€€€€€€˛
  7678. Î<¿¿p‡˝    00ʘ
  7679.      DÄ@à ˝    P˜ @ê˛ @†˜˛Çî√¿Ä`Lfiëæ „¯`r$aíËp˜˛B§!DÄĆíkjHA$†ì‰íî    4ê˜˛"´¢ DÄù¢BLH"A% B%˜$»"  É"Ñîê"ÇI¿$(I ˜$»$@ ¢ $Ñï¥$ÇÀ î+$™Àh˜Œú@p«Ä¿ÑöÿÉL¿ÔÃ√, L∞˜ ˘ĢÄÓ ˘Ä˙ÄÓ
  7680. ˘˘Ì€
  7681. ˛ÎÃ0Ê
  7682. $Ê$Ä@Ï˛Ç9òƒH√$7⁄˜ëæ[3ÄÔ˛C )G…%(I$$öííMTÄÔ˛"DJ*(0"âDêîHíÓ$r2(P$íH    !$$ê·Ó$*JHVIT-∂⁄%al≠∞îÄÔœÛ1üôÜX[,9†≥2–gÓ€€€€˛Ó˝éÓ√ÄÎ ¸ÑDC͸ÑDEͲ ÑgÇî›
  7683. <€Hà•Ͳ Dí•&íIMHà©Í˛ %™$¢JH(à™Í) I$3ê12Í+% Ÿm"P2ÍÃΔùiñqêGªßͯà@Á¯àÄÁ¯p€€€€€€€€€€€€€€˛0t¸È˛0à¸È˛0˛ È˛ Vö!ÅöM2ˆÿ°Äβ ìM"ÇM¶íJh“ÄÎÚI$ÇI$íR@îÍQGRH§úÄ    $ÍíTÇ$íY-≤Ä    ,ÄÎ?c√nÃÇ3Ͳ ˝Ë˛ ˝Ë ˛p˝8€˛Ë‡    w˛˚È    @à"˛IÈ    Äà$˛IÌ˛Ä    
  7684. fi—Iñèí…flf˚6Ó˛@kQ‡pìJíJI©$öÓ˛ 
  7685. "B!PíDíI    (êÓ $Ñ"â$à$êíH†Ó ≠ÑBÖl≤-∂VŸ Óƒ9÷ÑGŒ¥fiC∂[ö f Óı@ËıÄË€€ ˛˚¸Ê ˛I¸    ÄÁ˛IÄÁ˛ídˇ∂˘õÄÁ˛í%(Ÿ"M ÄÁ
  7686. ˛í$àë$HÊ
  7687. $HQDPÊ
  7688. -[5‘ê$Ê
  7689. ∂-Ÿ cLÊ€€ˇ f@ˇ ˇˇˇˇ@
  7690. ˇ·ˇ‚7^
  7691. 4*\˜, Palatino
  7692. .+l"CHAPTER €`)\3,     Helvetica
  7693.     (@lThe Slot Manager4⁄*˙¯
  7694. (‡*3 )-c)10
  7695.     )9Introduction to Slots and Cards
  7696. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  7697. g*w¯4g*w¯"g*_
  7698. ˇ·ˇ‚7^
  7699.     °dONLNdˇˇ(dl
  7700. Figure 3-6°dONLNd\Æg‹)B
  7701. The sRsrcT°dONLNd
  7702. \‹g").ype record format
  7703. —*‡¯4—*‡¯°dONLNdˇˇ(ÿlField descriptions
  7704. ˇ·ˇ‚7^
  7705. °dONLNd›lÈî*Category°dONLNd%›»È4)\The most general classifi °dONLNd>›5Èk)m
  7706. cation of car˚†°dONLNdK›jÈ„)5d functions. Some example .°dONLNdeÈ»ı(Ú»
  7707. categories arR`°dONLNdrÈı    ):e ,
  7708. CourierR`°dONLNdtÈ    ıE)
  7709. CatDisplayR`°dONLNd~ÈEıZ)< and R`°dONLNdÉÈZıñ)
  7710. CatNetworkR`°dONLNdçÈñıô)<..°dONLNdè¯lv(lcT+°dONLNdë¯vÜ)
  7711. ypeˇˇ˙.°dONLNdﯻE)RThe subclass of the categoryLH°dONLNd±¯ET)}. Wπ™°dONLNd¥¯T)
  7712. ithin the ˇˇÓ≠ưdONLNdæ¯Äº),
  7713. CatDisplayˇˇ˙≠ưdONLNd»¯º‰)<     categoryã°dONLNd—¯‰˜)(, for °dONLNd◊»(
  7714. »
  7715. example, therR`°dONLNd‰!)@e is a R`°dONLNdÎ!Q)TypVideoR`°dONLNdÛQ¡)0 subcategory; within the °dONLNd »(»
  7716. CatNetwork°dONLNd-)<     categoryd@°dONLNd,E)(, ther6†°dONLNd%E^)e is a 6†°dONLNd,^¶) TypAppleTalk6†°dONLNd8¶›)H  subcategory‡°dONLNdD‹fl)6..°dONLNdFl+Ü((lDrSW°dONLNdK»+)\The driver softwar˘¿°dONLNd]+õ)Re interface of the subcategoryb‡°dONLNd{õ+€)Å. For example, °dONLNdä+»7¶(4»0under the category Display and the subcategory V1 °dONLNd∫+¶7–)fi
  7717. ideo, ther¿°dONLNdƒ+–7Ë)*e is a ˇ˛ôÄ.°dONLNdÀ7»C˛(@»    DrSWAppleˇˇàİdONLNd‘7˛C")6 softwar⁄‡°dONLNd‹7"C≤)$!e interface, which indicates the '°dONLNd˝7≥C„)ë    Apple-def˜Ä°dONLNd7‚C˜)/ined .°dONLNd C»Ofi(L»;interface to work with QuickDraw using Macintosh Operating °dONLNdFO»[* System frame buf°dONLNdVO[()Nfers.°dONLNd\^ljä(glDrHW°dONLNda^»j˚)\ The identifií`°dONLNdm^˚jP)3cation of the specifi     °dONLNdÇ^Qjf)Vc harè¿°dONLNdá^fj})dwar«Ä°dONLNdã^}jÍ)e device associated with °dONLNd§j»v(s»the driver softwar`°dONLNd∂jvJ)P
  7718. e interface. °dONLNdƒÇléœ(ãlThe value of each sRsr\¿°dONLNd⁄ÇœéŸ)ccT¿°dONLNd‹ÇŸé{)
  7719. $ype entry is unique and assigned by fl†°dONLNdÇzéŒ)°Apple Developer T•‡°dONLNdÇŒéÙ)T    echnical °dONLNdélöì(ól    support. °dONLNd$†l¨í*The sRsr®¿°dONLNd,†í¨ )&cName entry contains an of¬°dONLNdF† ¨r)yfset to a cString data strÄ¿°dONLNd`†s¨ä)huctur†°dONLNde†ã¨‘)e containing the °dONLNdv¨l∏∏(µlsResource name.ñ¿°dONLNdÖ¨∏∏")L By convention, the sRsrˆ°dONLNdù¨"∏I)jcName fiflİdONLNd•¨J∏€)("eld is derived by stripping the prÅ`°dONLNd«¨‹∏Ê)íefiW¿°dONLNd ¨Á∏˜) xes °dONLNdŒ∏lƒs(¡lfrò‡°dONLNd–∏sƒß) om the sRsr¨¿°dONLNd€∏߃±)4cTW¿°dONLNd›∏±ƒ=)
  7720. ype values and separating the fi,‡°dONLNd˝∏>ƒå)çelds by underscorʆ°dONLNd∏åƒÊ)Nes. For example, the °dONLNd#ƒl–(ÕlsRsrm°dONLNd'ƒ–‡)cName for an sResour
  7721. `°dONLNd;ƒ·–)b
  7722. ce whose sRsr’¿°dONLNdHƒ–()=cTÄ¿°dONLNdJƒ(–b)
  7723.  
  7724. ype values ar=°dONLNdWƒc–õ); e CatDisplay Ä°dONLNdcƒõ–¶)8, T[@°dONLNdfƒ•–∑)
  7725. ypVò°dONLNdiƒ∑–œ)ideo, °dONLNdo–l‹Ü(ŸlDrSWц°dONLNds–Ü‹E)%Apple, and DrHWTFB becomes 'Display_Vi`°dONLNdò–E‹î)øideo_Apple_TFB'.°dONLNd©‚lÓL(Îl4Designing Cards and Drivers for the Macintosh Family“‡°dONLNd›‚LÓX)‡ pr°dONLNd‡‚YÓÂ)
  7726. ovides information about these °dONLNdˇÓl˙Õ(˜land other entry types.
  7727. * ¯4*¯ l¯
  7728. ˇ·ˇ‚7^
  7729. °dONLNd lõ*The Boar¸°dONLNd õœ)/    d sResouré°dONLNd' –€)5ceˇˇˇˇˇˇ(Ú3
  7730. °dONLNd*l+ì((lThe Boar°dONLNd2î+ø)(    d sResour·°dONLNd;ø+ )+ce is a special sResourΩ@°dONLNdR +M)a ce data str≥@°dONLNd]M+d)-uctur9 °dONLNdbe+Ø)e that must be prÀ¿°dONLNdsØ+„)J
  7731. esent in the °dONLNdÄ+l7r(4lfiå¿°dONLNdÇ+r7ê)rmwaro`°dONLNdá+ê7À)e of every carr‡°dONLNdï+À7å);)d that communicates with the Slot Manager—¿°dONLNdæ+ã7Ó)¿. By convention, it has °dONLNd÷7lCè(@lsResour≥@°dONLNd›7èC®)#ce ID ‡°dONLNd„7©C)$01 and it appears fi+°dONLNd¯7CN)Yrst in the sResourÁ`°dONLNd
  7732. 7NCf)Lce dirj`°dONLNd7gCÇ)ectory¬ °dONLNd7ÅCÉ).°dONLNdIlUœ(RlThe entries in the BoarË °dONLNd/IœU˙)c    d sResour∑ °dONLNd8I˚U ),
  7733. ce list pr@°dONLNdBI!Uµ)&!ovide the Slot Manager with a car…İdONLNdcIµUƒ)îd’s °dONLNdgUlaã(^lidentifiV†°dONLNdoUåaÃ) 
  7734. cation numberÎİdONLNd|UÀa?)?, vendor information, boarÆ °dONLNdñU@aN)ud flV†°dONLNdöUOaÌ)'ags, and initialization code. Like all .°dONLNd¡almé(jlsResourR`°dONLNd»aémΩ)" ce data str>`°dONLNd”aΩm”)/uctur¿°dONLNdÿa”m    ) es, the Boar„ °dONLNd‰am2)5    d sResourµÄ°dONLNdÌa2mñ)*ce list must include an µÄ°dONLNdañmÃ)d    sRsrcTypeµÄ°dONLNdaÃmË)6 entry .°dONLNdmlyü(vl and an sRsr+İdONLNd m†yŸ)4 cName entryK†°dONLNd+mÿy)8
  7735. . The Boar›†°dONLNd5my),d sRsrf`°dONLNd;m y*)cT`°dONLNd=m*yœ)
  7736. %ype entry must contain the constants .°dONLNdbylÖú(ÇlCatBoard°dONLNdjyúÖ≈)0
  7737.  ($0001), °dONLNdty≈Öı))TypBoard°dONLNd|yıÖ)0
  7738.  ($0000), °dONLNdÜyÖT))    DrSWBoard°dONLNdèyTÖê)6 ($0000), and °dONLNdùyêÖΔ)<    DrHWBoard°dONLNd¶yΔÖÔ)6
  7739.  ($0000). .°dONLNd∞Ölëì(élThe Boar°dONLNd∏Öîëø)(    d sResour·°dONLNd¡Öøë”)+<ce name does not follow the same convention as other sResourÈ`°dONLNd˝Ö”ëfi(é”ce °dONLNdëlù∑(ölnames—the Boarfl†°dONLNdë∑ù‚)K    d sResourƆ°dONLNdë„ùn), ce name is the name of the entirz¿°dONLNd7ëoùÉ)åe car˘†°dONLNd<ëÉùÊ)d, for example 'Mac II °dONLNdSùl©î(¶lMonochr∏@°dONLNdZùî©∞)(ome Vˆ‡°dONLNd_ù∞©’)ideo Carñ °dONLNdgù÷©‡)&d'.
  7740. wi∑¯4wi∑¯
  7741. ˇˇˇˇˇˇˇˇ4ÇoØN0Ço∞O
  7742. 4~k¨J0~k≠KVß°dONLNdˇˇ(çcTß°dONLNdˇˇ)
  7743. ype 0~kñLX˜°dONLNdˇˇ(§DrHW 0ïk≠L9ͰdONLNdˇˇ(çéCategory"~⁄/°dONLNdˇˇ(åa(2 worÂ`°dONLNdˇˇ)ds)°dONLNdˇˇ(¢a(2 worÂ`°dONLNdˇˇ)ds) °dONLNdˇˇ(£ïDrSWˇ<é@ˇ ˇˇˇˇ@
  7744. ˇ·ˇ‚7^
  7745. 4H\, Palatino
  7746. .+ä"CHAPTER €`)\3,     Helvetica
  7747.     (@äThe Slot Manager4⁄ä˙(‡äAbout the Slot Manager
  7748. ~¿(‡3
  7749. ‡)-a¿)11
  7750. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿
  7751. .°dONLNd\äh¥(eäThe BoarR`°dONLNd\¥hfi)*    d sResour$¿°dONLNd\fihR)*ce list must also contain a ,
  7752. Courier$¿°dONLNd-\Rh|)tBoardId$¿°dONLNd4\|hñ)* entry    °dONLNd:\ïh≥), a wor€`°dONLNdA\≤h
  7753. )d that contains the .°dONLNdUhätó(qäcarµ@°dONLNdXhótfl)
  7754. d design identifi‡°dONLNdih‡tY)Ication number assigned by E¿°dONLNdÉhYtfi)yApple Macintosh Developer TÒİdONLNdûh›t)Ñ    echnical °dONLNdßtäÄœ(}äSupport. Other C °dONLNd∂tœÄ˛)E    Apple-defi†°dONLNd¿tˇÄN)0ned entries specifiÍİdONLNd”tNÄâ)Ocally for BoarǰdONLNd·tâÄ¥);    d sResourõ‡°dONLNdÍtµÄ‚), ce data str뇰dONLNdıt‚Ģ)-uctur¿°dONLNd˙t˙Ä)es arc`°dONLNdˇtÄ)e °dONLNdÄäå¬(âä
  7755. discussed in Q†°dONLNdÄ√å£)94Designing Cards and Drivers for the Macintosh Familyà¿°dONLNdBÄ¢å§)fl..°dONLNdDòä§¢(°äFigurR`°dONLNdIò¢§∑)e 3-7R`°dONLNdNò∑§) shows a sample Boar$¿°dONLNdbò§B)a    d sResour˜ °dONLNdkòA§Ñ))ce. It shows an ˜ °dONLNd{òѧ∫)C    sRsrcType˜ °dONLNdÑò∫§œ)6 and ˜ °dONLNdâòœ§)    sRsrcName˜ °dONLNdíò§)6 °dONLNdì§ä∞(≠äentry and also includes thrR`°dONLNdƧ∞F)xee entry types, R`°dONLNdæ§F∞p)DBoardIDR`°dONLNd≈§p∞u)*, R`°dONLNd«§u∞Ω) PRAMInitDataR`°dONLNd”§Ω∞’)H, and °dONLNdŸ∞äºÃ(πä PrimaryInit°dONLNd‰∞úÚ)B    , that arR`°dONLNdÌ∞Úº0)&e discussed in .R`°dONLNd¸∞0º)>4Designing Cards and Drivers for the Macintosh Family.âİdONLNd0∞º)fl.
  7756. flH4‡H"‡H_
  7757. ˇ·ˇ‚7^
  7758.     .°dONLNdˇˇ(›ä
  7759. Figure 3-7°dONLNd2’Ç2)BSample Board sResource
  7760. H04H0
  7761. AHI4BHI BHB
  7762. ˇ·ˇ‚7^
  7763. ˇˇ£‰ˇÆ°dONLNdI.H@˝(<HAbout the Slot Managerˇˇˇˇˇˇ⁄|(< 3
  7764. °dONLNd`Qä]‰(ZäThe Slot Manager prÙ‡°dONLNdsQ‰])Z
  7765. ovides thrt °dONLNd}Q][)-ee basic services:,
  7766.  
  7767. Zapf Dingbats
  7768. °dONLNdêfämè(län
  7769. °dONLNdícñoÓ) OAt system startup time, it examines each slot and initializes any expansion cark¿°dONLNd·cÓo(lÓds it °dONLNdÁoñ{ú(xñfiå¿°dONLNdÈoú{Æ)nds.
  7770. °dONLNdÓÑäãè(ään
  7771. °dONLNdÅñçÓ) It maintains data str#‡°dONLNdÅÔç)Yuctur©¿°dONLNd
  7772. ÅçÛ)6es that contain information about each slot and every °dONLNd@çñô„(ññavailable sResour„‡°dONLNdQç„ô)M ce data strŸ‡°dONLNd\çô')-uctur_¿°dONLNdaç(ô/)e.
  7773. °dONLNdd¢ä©è(®än
  7774. °dONLNdfüñ´©) It prh°dONLNdkü©´‚)Fovides functions that allow you to get information about expansion carï °dONLNd±ü‚´(®‚ds and °dONLNd∏´ñ∑–(¥ñ
  7775. their sResourΆ°dONLNd≈´–∑˝): ce data str·†°dONLNd–´˝∑)-ucturgİdONLNd’´∑ )es.
  7776. ÔH¸4H¸
  7777. H¸4ÔGHò:u u Hc«« ÷0¿c¯ ÷ÿ0¿`¯÷
  7778. fl?˘˘„·Ûü9Ï˝÷
  7779. fl∑ºÌˇcÒˇfl̸˝÷
  7780. fløûÌ„cÒ˛Ì∏˝÷
  7781. ˜øº˘Ω„Ò˚flπò˝Ã˝Ã0˝«««««⁄ˇ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ
  7782. ‹‡ˇÄ
  7783. ‹˛ˇÄ ‚?˙ˇˇÄ„‡¸¯ˇÄ„˚ÄˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ¸~¸0¸Ä∞˘˘ˇÄ¸{¸ÿ0¸ÄĢ˘ˇÄ¸{¸ fløÛÁ|Á±ÛΩ˛p˙˘ˇÄ¸{¸ €˜∂„ˇˇ∑Òfiflªx˙˘ˇÄ¸{¸ flˇ∂√¸∂·fi?ªx˙˘ˇÄ¸~¸ Ûˇú√˜˛ÊaÛfl˛x˙˘ˇÄÔ`ˆ˘ˇÄÔ¿ˆ˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄΡĸ˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸ ˘ˇÄΡ¿¸˘ˇÄΡ¿¸8˘ˇÄΡ¿¸‡˘ˇÄ    ¡ÄÊ    Ρ¿‡    Ρ¿‡    Ρ¿‡    Ρ¿‡Ρ¿ÛˇΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ıˇÄΡ¿ıˇÄΡ¿ıˇˇÄ ‹ˇˇÄΡ¿ıˇÄΡ¿ıˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄ    Ρ¿‡    Ρ¿‡    Ρ¿‡    Ρ¿‡    Ρ¿‡Ρ¿ÛˇΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ı‡ˇÄΡ¿ı˛ˇÄ ‹ˇˇÄΡ¿ı¯ˇÄΡ¿ıÄˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄΡ¿ÛˇÄ¡¿˘ˇÄΡ¿¸x˘ˇÄΡ¿¸ ˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄΡ¿¸˘ˇÄ?Ρ¿¸˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ„Ê„Ê„Ê„Ê„Ê „˘ˇ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ „˘ˇÄ
  7784. „Ä˙ˇÄ ‚Ä˙ˇÄ‚¿¸ÄˇÄ‚p¸¯ˇÄ ‚˙ˇˇÄ
  7785. ‹ˇˇÄ
  7786. ‹‡ˇÄ
  7787. ‹ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ⁄ˇÄ««««««««««««««««««««««««∞‡ 0?@ÄaɯÄɇ¿Ä·¿H˝Ä"DH˛Å@@·@"à˝Ä$@@˛Å@@·!)@"à"«Â≥D@åÈå5&≥ÉàôΔe≥Â!*@Bà<I$’H@Ñ¥îIÈ$‘Ñè*I$’(Â!*áDp$I$â8HÄѧ†âDàÇ
  7788. I$àHÂ!"LÄD@ÜIàÅE íI    pëIpÂ!"LÄH`@§[    âId∂Ñ2[ Dê R[    HÂ!\È¿1ćŒ-ΔÇqò[Ã-á8Ûå-0 ˘˚Äÿ ˘˚Äÿ ˘˚¿ÿ««‡0‡˝›á÷ ¿˝àÜ÷ @˝àä÷C<)M–”Õ∞ëJ÷Dê*Ri$î–ëR÷Hê*¢J$§ÄQT÷"à†L§íC9b"d÷"©(L≠ñ“%""d÷\Δ0È÷ôg'wN÷˘Ä“˘Ä“˘–«««««««««««««««««Ä@˝Ä’ÄÄ˝‘ ÄÄ‘4—§”/f¬–¿÷    i( $⁄i$£Bi@÷
  7789. IH DíI%"J’
  7790. "äp E$äIƒí’!$í»"I%í€$ñ@÷s∏„01&·lƒôÑ÷
  7791. ˛A˝–
  7792. ˛A˝– ˛„IJÄ—««« Äpœ @ œ @@œ
  7793.     åy˘ôh—
  7794.     íI    4†—
  7795.     $íI    $@—
  7796.     8aäíHÄ—
  7797.     $AVÀ —
  7798.     8„ÑÎM‡—˛DÕ˛hÕ˝„∞Õ«« ò¸0“ à¸H$“
  7799. à ÄD“
  7800.     N˚7Ÿ∞D“
  7801.     RMI$–`Ñ“
  7802.     HHâDÄà“
  7803. $ÑêíEà“
  7804. ≠≤∞∂… ê“
  7805. ;2‹–[1¬`“««ò:u u Hc«« ÷0¿c¯ ÷ÿ0¿`¯÷
  7806. fl?˘˘„·Ûü9Ï˝÷
  7807. fl∑ºÌˇcÒˇfl̸˝÷
  7808. fløûÌ„cÒ˛Ì∏˝÷
  7809. ˜øº˘Ω„Ò˚flπò˝Ã˝Ã0˝«««««⁄ˇ
  7810. ⁄˘@˙Ä
  7811. ⁄˘@˙Ä
  7812. ⁄˘@˙Ä
  7813. ⁄˘@˙Ä
  7814. ⁄˘@˙Ä
  7815. ⁄˘@˙Ä
  7816. ⁄˘@˙Ä⁄¿N@¿Ä‹‡ I@Ä‹˛Ènn@/파Ä‚?˙ˇNìR@*]#íÄ„‡¸¯-IùR@*S-íÄ„˚Ä«ngN@ú«éÄ„˘˘@˝Ä„˘˘@"˝Ä„˘˘@˝Ä„˘˘@˙Ä„˘˘@˙Ä„˘˘@˙Ä„˘˘@˙Ä „˘ˇÄ„˘˘@˙Ä„˘˘@˙Ä„˘˘@˙Ä„˘˘@˙Ä!¸~¸0¸Ä∞˘˘˘@˙Ä!¸{¸ÿ0¸ÄĢ˘˘@˙Ä$¸{¸ fløÛÁ|Á±ÛΩ˛p˙˘˘@˙Ä-¸{¸ €˜∂„ˇˇ∑Òfiflªx˙˘§‡@p$•¿ Ä-¸{¸ flˇ∂√¸∂·fi?ªx˙˘ ¥ê@H$µ  Ä-¸~¸ Ûˇú√˜˛ÊaÛfl˛x˙˘ú¥ñvp@K$µ&χÄÔ`ˆ˘
  7817. ¥Èê@J<µ…9 ÄÔ¿ˆ˘"Hôlê@J$I)Ÿ Ä„˘HÊ<p@r$IΔx‡Ä„˘˘@˙Ä„˘˘@˙ÄΡĸ˘˘@˙Ä@˙Û¿¸˘˘@˙Ä@˙Û¿¸˘˘@˙Ä@˙Û¿¸ ˘˘@˙Ä'    @渠   Ä¸¿¸˘˘@˙Ä$    @@ĸíIJ¿¿¸8˘ˇÄ$    @2MòØå¸Õ¿˛‡¿¸‡˘ˇÄ    @{ü$™^¸S˛Ä˛˙ˇÄÊ    @j[ ™P¸ì∞IJ¿¿‡    @2Mì鸌¿˛Ä¿‡@˝Û¿‡@˝"Û¿‡@˝Û¿Ûˇ@˙Û¿ÛÒÄΡ¿ÛÒÄ@˙Û¿ÛÒÄ@˙Û¿ÛÒÄ@˙Û¿ÛÒÄ"    @ĸ    Ä˝Ä¿ıÒÄ(    @     ĸíIJ¿¿ı˙à˙Ä(    @…6jªC¸Õ¿˛‡¿ıˇ˙ Ä˙Ä&    @Ó|öéßĸS˛Ä˛Òˇ˚ùÎú˚Ä*    @©lâ∂§¸ì∞IJ¿¿ı˚J d˚Ä)    @…4xû£Ä¸Œ¿˝Ä¿ı˚" d˚Ä@˙Û¿Û˚‹ \˚Ä@˙Û¿Û¯˚Ä@˙Û¿Û¯8˚ÄΡ¿ÛÒÄ@˙Û¿ÛÒÄ@˙Û¿ÛÒÄ@˙Û¿ÛÒÄ@˙Û¿ÛÒÄ    @Ö¿¸¿ ˚¿ÛÒÄ    @ÄÖ ¸  ˚¿ÛˇÄ    @õõÖ ¸.|˚¿ÛˇÄ    @$‘Ö ¸#&˚¿‡    @ßTÖ ¸-:˚¿‡    @”Ö¿¸«>˚¿‡
  7818. @˙Û¿‡
  7819. @˙Û¿‡@˙Û¿ÛˇΡ¿Û˛ıÄ@˙Û¿Û˛ıÄ@˙Û¿Û˛ıÄ@˙Û¿Û˛ıÄ@˙Û¿Û˛ıÄ#    @pëSÄĸ    Ä¸¿Û˛ıÄ'    @    I[@ĸíIJÄ¿ı‡˛ıÄ0    @    I[zy¸Õ¿˛¿¿ı˛ÿ¿ à@˛Ä+    @q€RLò¸S˛Ä˛Òˇ • †à@˝Ä0    @J5Rt˸ì∞IJ¿¿ı¯• ∫⁄néL÷5ÏÄ0    @J5[ú¯¸Œ¿˛Ä¿ıÄ &æìâS8|^Ä!@˙Û¿Û• &∂çâSlêÄ!@˙Û¿Ûÿ¿%wéLÚ5ÓÄ@˙Û¿ÛįÄΡ¿Û˛¯Ä@˙Û¿Û˛ıÄ@˙Û¿Û˛ıÄ@˙Û¿Û˛ıÄ#    @8@¸    Ä¸¿Û˛ıÄ%    @$¸íIJÄ¿Û˛ıÄ     @'Z;[◊¸Õ¿˛¿¿ÛˇÄ/    @:US2¸S˛Ä˛˙ˇ¿˘˛˝@˛˛Ä1    @"U6S2¸ì∞IJ¿¿¸x˘˛˝@˛˛Ä1    @"U#3¸Œ¿˛Ä¿¸ ˘˛˝@˛˛Ä'@˝ Û¿¸˘˛˝@˛˛Ä'@˝@Û¿¸˘˛˝@˛˛Ä$@˙Û¿¸˘˛˝@˛˛Ä%@˙Û¿¸˘ÿ¿;@‡@Ä!Ρ¿¸˘• T§@ê@0    Ä%@˙Û¿¸˘• 4§@õÏ}ÅÄ%@˙Û¿¸˘ §@Í^KΔÄ%@˙Û¿¸˘• T§@öPJÄ1    @ü‡˝áòø¿¸˘ÿ¿;@‰nçœÄ1@Q˛˝≥"e2¸¿¸˘Ä@ÄÄ0@˛˝ì"e2¸¿¸˘˛˝    @Ä/    @fl‡¸Û"e2¸¿¸˘˛˝@˛˛Ä0@Q˛˝≥"e2¸¿¸˘˛˝@˛˛Ä0@벽áòø¿¸˘˛˝@˛˛Ä+@˝¸Ä˘¿¸˘˛˝@˛˛Ä$@˙Û¿¸˘˛˝@˛˛Ä$@˙Û¿¸˘˛˝@˛˛Ä@˙Û¿¸˘ˇÄ$@˙Û¿¸˘˛˝@˛˛Ä Ρ¿¸˘˛˝@˛˛Ä ?Ρ¿¸˘˛˝@˛˛Ä„˘˛˝@˛˛Ä„˘˛˝@˛˛Ä„˘˛˝@˛˛Ä„˘˛˝@˛˛Ä„˘8 Ä@‡@8Ä„˘$ÇÄ@ê@@Ä„˘%flbÄ@õÏp}éÄ„˘9OÜRÛ¿@Í^K…Ä„˘%L“ÄÄ@öPHJ    Ä„˘8èå#pÄ@‰n0çΔÄ„˘Ä @ÄÄ„˘@@Ä„˘˛˝@˛˛Ä„˘˛˝@˛˛Ä„˘˛˝@˛˛Ä„˘˛˝@˛˛Ä„˘˛˝@˛˛Ä „˘ˇÄ „˘ˇÄ„Ê„Ê„Ê„Ê„Ê „˘ˇ„˘˛ıÄ„˘˛ıÄ„˘˛ıÄ„˘˛ıÄ„˘˛ıÄ„Ä˙˛ıÄ‚Ä˙
  7820. ÿ¿»Ä"˛Ä‚¿¸Ä• ("˝Ä‚p¸¯• .∂õ£ì5ç{Ä‚˙ˇ …ا‚TŒÄÄ‹ˇ•     ≠£bT≈$Ä‹‡ÿ¿    Fù„ì<ç{ÄċIJ@˘Ä⁄˛˛Ä˘Ä
  7821. ⁄˛ıÄ
  7822. ⁄˛ıÄ
  7823. ⁄˛ıÄ
  7824. ⁄˛ıÄ
  7825. ⁄˛ıÄ
  7826. ⁄˛ıÄ⁄ˇÄ⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄ Ä3â@˛Ä⁄@JI@ÄÄ⁄L∞ÇI@ôô€Ä⁄û†Éâ@?˝W§Ä⁄P†J    @£aT$Ä⁄N@2@ùù#úÄ⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄˛˝@˙Ä⁄ˇÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ⁄˚¿(¸Ä⁄¸ P¸Ä⁄¸s ˛g¸Ä⁄¸    óí_Ú¸Ä⁄¸)î]ǸÄ⁄˚ΔsåVs¸Ä    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ⁄ˇÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ⁄˙˙Ä⁄˙$˙Ä⁄˙@Œ`˚Ä⁄˙A2˚Ä⁄˙%2Ä˚Ä⁄˙Œp˚Ä    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ    ⁄ÒÄ⁄ˇÄ⁄ˇÄ««««««««««««««««««««««««∞‡ 0?@ÄaɯÄɇ¿Ä·¿H˝Ä"DH˛Å@@·@"à˝Ä$@@˛Å@@·!)@"à"«Â≥D@åÈå5&≥ÉàôΔe≥Â!*@Bà<I$’H@Ñ¥îIÈ$‘Ñè*I$’(Â!*áDp$I$â8HÄѧ†âDàÇ
  7827. I$àHÂ!"LÄD@ÜIàÅE íI    pëIpÂ!"LÄH`@§[    âId∂Ñ2[ Dê R[    HÂ!\È¿1ćŒ-ΔÇqò[Ã-á8Ûå-0 ˘˚Äÿ ˘˚Äÿ ˘˚¿ÿ««‡0‡˝›á÷ ¿˝àÜ÷ @˝àä÷C<)M–”Õ∞ëJ÷Dê*Ri$î–ëR÷Hê*¢J$§ÄQT÷"à†L§íC9b"d÷"©(L≠ñ“%""d÷\Δ0È÷ôg'wN÷˘Ä“˘Ä“˘–«««««««««««««««««Ä@˝Ä’ÄÄ˝‘ ÄÄ‘4—§”/f¬–¿÷    i( $⁄i$£Bi@÷
  7828. IH DíI%"J’
  7829. "äp E$äIƒí’!$í»"I%í€$ñ@÷s∏„01&·lƒôÑ÷
  7830. ˛A˝–
  7831. ˛A˝– ˛„IJÄ—««« Äpœ @ œ @@œ
  7832.     åy˘ôh—
  7833.     íI    4†—
  7834.     $íI    $@—
  7835.     8aäíHÄ—
  7836.     $AVÀ —
  7837.     8„ÑÎM‡—˛DÕ˛hÕ˝„∞Õ«« ò¸0“ à¸H$“
  7838. à ÄD“
  7839.     N˚7Ÿ∞D“
  7840.     RMI$–`Ñ“
  7841.     HHâDÄà“
  7842. $ÑêíEà“
  7843. ≠≤∞∂… ê“
  7844. ;2‹–[1¬`“««ˇ"ƒ@ˇ ˇˇˇˇ@
  7845. ˇ·ˇ‚7^
  7846. 4*\˜, Palatino
  7847. .+l"CHAPTER €`)\3,     Helvetica
  7848.     (@lThe Slot Manager4⁄*˙¯
  7849. (‡*3 )-c)12
  7850.     )9About the Slot Manager
  7851. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  7852. °dONLNd\lhÄ(elTher¿°dONLNd\Åhë)e ar`°dONLNd\ëh9)&e two variations of the system softwar `°dONLNd.\9h)®*e version 7.0 Slot Manager: version 1 and °dONLNdXhlt†(ql version 2. VΠ°dONLNddhüt¡)3Bersion 1 of Slot Manager is supplied with the version 7.0 System fiÍ¿°dONLNdßh¬tÔ(q¬ le on disk °dONLNd≤tlÄõ(}lCfor use with Macintosh II-family computers designed and built beforÿ‡°dONLNdıtõÄ‘(}õ
  7853. e the system °dONLNdÄlåç(âlsoftwar‰¿°dONLNd    Äçå)!e version 7.0 was available. V^ °dONLNd'Äåˆ)Å3ersion 2 is included in the ROM of newer Macintosh °dONLNdZålòΔ(ïlII-family computers.°dONLNdoûl™d*6When the user starts up a Macintosh II-family computer« °dONLNd•ûc™Ù)˜", the version of the Slot Manager °dONLNd«™l∂£(≥l in ROM searİdONLNd“™§∂c)8+ches each slot for a declaration ROM and crµ°dONLNd˝™c∂Ä)øeates aG†°dONLNd™Å∂Ì) slot information recordM`°dONLNd™Ì∂Ô)l °dONLNd∂l¬ò(ølCfor each slot. The section “Getting Information about Expansion CarŸ`°dONLNd`∂ò¬Ó(øòds and Declaration ˇˇx .°dONLNds¬lŒí(ÀlROMs” r l°dONLNdz¬íŒ§)&eferúðdONLNd~¬§Œ7)#ence section, later in this chapter7®°dONLNd°¬7Œ|)ì, shows the defiüðdONLNd±¬|Œ¥)Enition of the ,
  7854. Courierˇ˛h$°dONLNdø¬µŒ˜)9 SInfoRecordˇˇx °dONLNd ¬˜Œ¯)B .°dONLNdÀŒl⁄ó(◊l
  7855. data type.
  7856. Á*Ù¯4Ë*Û¯
  7857. °dONLNdˇˇ*NOTE
  7858. ˇ·ˇ‚7^
  7859. °dONLNd÷Òl˝ö* AThe ROM of early Macintosh II-family computers may contain early °dONLNd˝l    * &versions of the Slot Manager that addr˜ °dONLNd=˝    S)©
  7860. ess NuBus car%‡°dONLNdJ˝T    £)?ds in 24-bit mode °dONLNd\    l(l(and may not be able to identify some carŒÄ°dONLNdÑ    .)≥ds. »‡°dONLNdà    .°)After version 1 of the Slot °dONLNd§l!(l'Manager is loaded, it locates these carqİdONLNdÀ!")ßds. ,
  7861.  
  7862. Zapf Dingbats
  7863.  @°dONLNdˇˇ)u
  7864. °dONLNd‰'l3⁄(0lAs the Slot Manager searü@°dONLNd¸'⁄3A)nches the slots, it identifi`İdONLNd'B3ô)hes all of the sResour‡°dONLNd,'ö3«)X ce data str‡°dONLNd7'«3fi)-ucturç¿°dONLNd<'fi3Ù)es in °dONLNdB3l?Ï(<leach declaration ROM and crO°dONLNd]3Ì?<)Åeates a table—the ;°dONLNdo3=?Ñ)PSlot Resource TƒÄ°dONLNd~3É?ñ)Fable4 °dONLNdÇ3ó?ß), or @°dONLNdá3®?µ)SR„İdONLNdâ3¥?∫) Tè°dONLNdä3ª?Ï) —that lists °dONLNdñ?lK∏(Hlall of the sResour™¿°dONLNd®?∏KÂ)L ce data str†¿°dONLNd≥?ÂK¸)-uctur&†°dONLNd∏?˝K)es curr‹@°dONLNdø?Kú)ently available to the system. °dONLNdflQl]á(Zl?The Slot Manager then initializes the six parameter RAM bytes rÃ`°dONLNdQá]Ô(Záeserved for each slot. If .°dONLNd8]liÓ(flthe slot has an expansion carR`°dONLNdU]Ói)Ç    d with a R`°dONLNd^]i_)) PRAMInitDataR`°dONLNdj]_i™)H entry in its Boar$¿°dONLNd|]™i‘)K    d sResour˜ °dONLNdÖ]”iÛ))ce, the .°dONLNdçiluÚ(rlZSlot Manager uses the values in that entry to initialize the parameter RAM; otherwise, it °dONLNdÁulÅ* %clears the parameter RAM bytes to 0. °dONLNd
  7865. álì™*HAfter the parameter RAM initialization, the Slot Manager disables interr†°dONLNdUá™ì”(ê™    upts and .°dONLNd^ìlüÿ(úlexecutes the code in the °dONLNdwìÿü)l PrimaryInit°dONLNdÇìüg)B entry of each carR`°dONLNdîìgüå)Md’s Boar$¿°dONLNdúìåü∂)%    d sResour˜ °dONLNd•ìµü√))ce. .°dONLNd™•l±…(ÆlIf certain values (defiΩ`°dONLNd¡•…±G)]ned by the Start Manager) arJ@°dONLNd›•H±~)e set in a carK‡°dONLNdΕ~±Ô)6d’s parameter RAM, a carú†°dONLNd•Ô±˜)qd .°dONLNd±lΩí(∫lwith an °dONLNd
  7866. ±íΩ⁄)& sRsrcBootRec°dONLNd±⁄Ωô)H* entry may take over the system startup prR`°dONLNdC±ôΩÈ)øocess. The system .°dONLNdUΩl…ú(Δl gives contr‚‡°dONLNd`Ωú…¨)0Aol to the code in this entry early in the startup sequence, beforW°dONLNd°Ω≠…Ê(Δ≠
  7867. e the system °dONLNdÆ…l’ò(“l
  7868. patches arQ¿°dONLNd∏…ô’¡)-    e loaded.°dONLNd¬€lÁL(‰l4Designing Cards and Drivers for the Macintosh Family.“‡°dONLNdˆ€LÁã)‡ describes the “‡°dONLNd€ãÁ”)? PRAMInitData“‡°dONLNd€”Áÿ)H, °dONLNdÁlÛÆ(l PrimaryInit°dONLNdÁÆÛΔ)B, and °dONLNd$ÁΔÛ) sRsrcBootRec°dONLNd0ÁÛF)H
  7869.  entry types..°dONLNd>˘lê(l    If no carÆÄ°dONLNdG˘ê≈)$ d takes overΩ°dONLNdS˘≈p)5', the normal system startup continues. ô†°dONLNdz˘p„)´After version 1 of the Slot °dONLNdñl0(l,Manager is loaded, it conducts a second sear/‡°dONLNd¬1Ú)≈-ch for declaration ROMs, this time in 32-bit °dONLNdÔl¢(l
  7870. mode. If it fiò¿°dONLNd˝¢ )6nds any new NuBus carİdONLNd     v)jds, it adds their sResourd °dONLNd    +v£)j ce data strZ °dONLNd    6£∫)-uctur‡°dONLNd    ;∫Ù)es to the Slot .°dONLNd    Jl)ä(&lResourR`°dONLNd    Pä)õ)ce Tg`°dONLNd    Tö)7)$able and executes the code in their g`°dONLNd    x7)y)ù PrimaryInitg`°dONLNd    Éy)´)B  entries. (VK†°dONLNd    è™)Î)1ersion 2 of the .°dONLNd    ü)l5¶(2l Slot Manager¥†°dONLNd    ´)¶5Ã):    , which rL°dONLNd    ¥)Õ5ø)'5esides in ROM, does not need to conduct a second sear!`°dONLNd    È)ø5œ)Úch.)°dONLNd    Ó;lGÿ(DlUAfter all system patches have been installed, version 1 or later of the Slot Manager .°dONLNd
  7871. CGlSŸ* executes the code in any °dONLNd
  7872. \GŸS')m
  7873. SecondaryInit°dONLNd
  7874. iG'S[)N
  7875.  entries it fi°dONLNd
  7876. wG[SÎ)4 nds in the declaration ROMs. It °dONLNd
  7877. óSl_ñ(\l
  7878. does not rR`°dONLNd
  7879. °Sñ_Ó)*eexecute the code fr$¿°dONLNd
  7880. µSÓ_˝)Xom $¿°dONLNd
  7881. ∏S˝_?) PrimaryInit$¿°dONLNd
  7882. √S?_i)B  entries, r˜ °dONLNd
  7883. ŒSh_ˆ))einitialize parameter RAM, or °dONLNd
  7884. Ï_lkp(hlrR`°dONLNd
  7885. Ì_pkÜ)estor$¿°dONLNd
  7886. Ú_Ük¬)
  7887. e any sResour˜ °dONLNd
  7888. ˇ_¡k); ce data str„ °dONLNd
  7889. _k)/ucturµÄ°dONLNd _kU)es deleted by the µÄ°dONLNd !_Ukó)O PrimaryInitµÄ°dONLNd ,_ók≤)B code. 
  7890. y*Ö¯4y*Ö¯
  7891. .°dONLNdˇˇ(ÄlNOTE
  7892. ˇ·ˇ‚7^
  7893. °dONLNd 4Élès* Vú`°dONLNd 5Érèè)Bersions of the Slot Manager earlier than version 1 do not execute .°dONLNd wèlõä(òlcode frR`°dONLNd ~èäõô)om R`°dONLNd ÅèôõÁ)
  7894. SecondaryInitR`°dONLNd éèÁõ
  7895. )N
  7896.  entries. 
  7897. .R`°dONLNdˇˇ))u
  7898. .°dONLNd ≠°l≠ˇ(™l After the Slot Manager executes °dONLNd Õ°ˇ≠M)ì
  7899. SecondaryInit°dONLNd ⁄°M≠Ö)N code, it searR`°dONLNd ˰Ö≠Ã)8ches for sResour$¿°dONLNd ¯°Ã≠Ô)Gce data ˇˇ›®°dONLNd ≠lπx(∂lstrl°dONLNd ≠xπé) uctur>`°dONLNd ≠éπ÷)es that have an ˇˇò¯µ°dONLNd ≠÷π)H
  7900. sRsrcFlagsˇˇ›®µ°dONLNd "≠πX)< entry with the ˇˇò¯+†°dONLNd 2≠Yπ°)G fOpenAtStartˇˇ›®+†°dONLNd >≠°π©)H fl    H°dONLNd A≠™π¯)    ag set. When the ˇ(§@ˇ ˇˇˇˇ@
  7901. ˇ·ˇ‚7^
  7902. 4H\, Palatino
  7903. .+ä"CHAPTER €`)\3,     Helvetica
  7904.     (@äThe Slot Manager4⁄ä˙(‡äUsing the Slot Manager
  7905. ~¿(‡3
  7906. ‡)-a¿)13
  7907. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿
  7908. °dONLNd\ähÕ(eäSlot Manager fi˛¿°dONLNd\Õh)Cnds an sResour-İdONLNd\h>)D ce data str#İdONLNd(\>hU)-uctur©`°dONLNd-\Uhã)
  7909. e with this flå°dONLNd;\åh¸)7ag set, it loads the device .°dONLNdWhät±(qä    driver frR`°dONLNd`h±t“)'om the ,
  7910. CourierR`°dONLNdgh“t)! sRsrcDrvrDirR`°dONLNdshtu)H entry of the sResour$¿°dONLNdàhut˚)[ ce, or calls the code in sResour˜ °dONLNd®h˙t )Öce’s °dONLNd≠täÄ“(}ä sRsrcLoadRec°dONLNdπt“ÄÏ)H entryd@°dONLNdøtÎÄ_), which loads the sResour6†°dONLNdÿt_ÄÆ)tce’s device drivery@°dONLNdÍt≠Ä∞)N.°dONLNdÏÜäí≠(èäFinallyd@°dONLNdÛܨíQ)"&, the system executes initialization (d@°dONLNdÜQíu)•'INIT'd@°dONLNdÜuí)$) r6†°dONLNd"Üíñ)
  7911. esour    °dONLNd'Üñí¶)ces..°dONLNd,òä§õ(°äSee ”°dONLNd0òõ§{)4Designing Cards and Drivers for the Macintosh Family%‡°dONLNddò|§Ÿ)· for details about the .°dONLNd{§ä∞Δ(≠ä
  7912. sRsrcFlags°dONLNdÖ§Δ∞À)<, °dONLNdá§À∞) sRsrcDrvrDir¬†°dONLNdì§∞*)G, and ¬†°dONLNdô§*∞r) sRsrcLoadRec¬†°dONLNd•§r∞™)H
  7913.  entry types.
  7914. µH–4∂H–
  7915. ·HÈ4‚HÈ ‚H‚
  7916. ˇ·ˇ‚7^
  7917. ˇˇ£‰.ˇÆ°dONLNd≥ŒH‡¸(‹HUsing the Slot Managerˇˇˇˇˇˇ⁄|(‹ 3
  7918. °dONLNd Òä˝(˙äThe majority of Slot Manager r‡°dONLNdËÒ˝F)à outines sear”‡°dONLNdÙÒF˝Ö)4ch for sResour¿°dONLNdÒÜ˝≥)@ ce data str˙¿°dONLNd
  7919. Ò≤˝…),ucturưdONLNdÒ ˝)es in the Slot °dONLNd!˝ä    ©(äResourv@°dONLNd'˝©    ∫)ce Te‡°dONLNd+˝∫    ‰)
  7920. able or prŒ¿°dONLNd5˝‰    =)*ovide information fråİdONLNdI˝>    s)Z om these str°dONLNdU˝t    ã)6ucturù‡°dONLNdZ˝ã    ô)es. °dONLNd_ä‰(äThe Slot Manager prÙ‡°dONLNdr‰r)Z ovides a variety of methods to fiE`°dONLNdìs≤)è
  7921. nd an sResour7 °dONLNd†≤fl)? ce data str- °dONLNd´flˆ)-uctur≥°dONLNd∞ˆˇ)e. °dONLNd≥ä'($äThese methods include sear İdONLNdÕ'_){ching for an sResour◊†°dONLNd·_'å)Z ce data strÕ†°dONLNdÏå'£)-ucturSİdONLNdÒ§'˜)e with a particular °dONLNd'ä3≠(0äsResour≥@°dONLNd '≠3⁄)# ce ID, searTİdONLNd'€35).ching for an sResour†°dONLNd+'63c)[ ce data str†°dONLNd6'c3z)-ucturõİdONLNd;'z3)e with a particular sResour]`°dONLNdV'Ò3)w    ce type, °dONLNd_3ä?õ(<äsearK†°dONLNdc3ú?ƒ)    ching thr.‡°dONLNdl3ƒ?)(ough all sResour°dONLNd|3?;)J ce data str°dONLNdá3;?R)-ucturㇰdONLNdå3R?q)es, sear^ °dONLNdî3r?ö)     ching thrA`°dONLNdù3ö?ˇ)(ough only the enabled °dONLNd≥?äK≠(HäsResour≥@°dONLNd∫?≠K⁄)# ce data str©@°dONLNd≈?⁄KÒ)-uctur/ °dONLNd ?ÚK-)es, and so on.°dONLNdŸQä]¯(ZäThe Slot Manager also pr¿°dONLNdÒQ˘]T)oovides a number of rµ°dONLNdQT]é)[outines that rOİdONLNdQè]Á);eturn information fr˙‡°dONLNd'QÁ]˜)Xom .°dONLNd*]äi¨(fäsResourR`°dONLNd1]¨i1)" ce list entries. Some of these r$¿°dONLNdQ]1i})Öoutines, like the $¿°dONLNdc]}i≥)L    SReadByte$¿°dONLNdl]≥i»)6 and $¿°dONLNdq]»i
  7922. ) SGetCString$¿°dONLNd|]
  7923. i )B .°dONLNd}iäuº(rä functions, rê@°dONLNdâiºuY)2%eturn one particular type of data str İdONLNdÆiZuq)ûucturí`°dONLNd≥iquŸ)e. Some others, like the .°dONLNdÃuäÅÃ(~ä SFindStruct°dONLNd◊uÃÅ )B function, can rR`°dONLNdÁu ÅØ)@$eturn information about any data str>`°dONLNd uØÅ≈)£uctur¿°dONLNdu≈Å)e. Still other °dONLNdÅäç…(ääfunctions, the °dONLNd.Å…ç)?
  7924. SGetDriver°dONLNd8Åç)< and °dONLNd=Åç8)SExec°dONLNdBÅ8çë) functions, not only rR`°dONLNdXÅëçÍ)Yeturn information fr$¿°dONLNdlÅÍç)Yom an .°dONLNdrçäô≠(ñäsResour≥@°dONLNdyç≠ô⁄)# ce data str©@°dONLNdÑç⁄ôÒ)-uctur/ °dONLNdâçÚô()
  7925. e but also pr´‡°dONLNdñç(ô€)6(eform functions like loading the sResourÕ`°dONLNdæç€ô¸)≥ce data .°dONLNdΔôä•ñ(¢ästrl°dONLNd…ôñ•¨) uctur>`°dONLNdŒô¨•P)'e’s driver or executing the code of an >`°dONLNdıôP•å)§
  7926. SExecBlock>`°dONLNdˇôå•≤)<     data str*`°dONLNdô≤•»)&uctur¸¿°dONLNd
  7927. ô«•œ)e..°dONLNd´ä∑⁄(¥äIn addition to searD‡°dONLNd#´€∑()Qching for sResour憰dONLNd4´(∑U)M ce data str¥†°dONLNd?´U∑l)-uctur:İdONLNdD´m∑)"es and getting information out of °dONLNdf∑ä√¥(¿äAthem, the Slot Manager allows you to enable and disable NuBus carF@°dONLNdß∑µ√    (¿µds, manipulate the °dONLNd∫√䜺(Ãä Slot Resour÷@°dONLNd≈√ºœÕ)2ce T≈‡°dONLNd…√Õœ2)able, get information frn‡°dONLNd·√3œë)fom slot information rñ°dONLNdˆ√뜣)^ecor
  7928. `°dONLNd˙√§œfl)ds, get status °dONLNd    œä€€(ÿäinformation, and rmİdONLNdœ€€_)Qead and change expansion car°dONLNd7œ`€∫)Öds’ parameter RAM.
  7929.  H4 H  ä 
  7930. ˇ·ˇ‚7^
  7931. ˇˇ◊ˇ◊°dONLNdJ˙ä ~(ä Enabling and Disabling NuBus Carß°dONLNdj˙~ é)Ùdsˇˇˇˇˇˇ®)ê3
  7932. °dONLNdmäë(äVú`°dONLNdnê)Tersion 1 and later of the Slot Manager allows you to temporarily disable your NuBus °dONLNd¬ä)ó(&äcarµ@°dONLNd≈ó)¢)
  7933. d. £`°dONLNd»¢)®) Yc‡°dONLNd…®)y)0ou might want to do this, for example, if you arp °dONLNd˘y)‰)—e designing a NuBus carŸ°dONLNd‰))kd that °dONLNd)ä5ƒ(2ä must be addr(@°dONLNd#)≈5E);essed in 32-bit mode or that r√`°dONLNdA)E5\)Äequir⁄†°dONLNdF)\5·)es RAM-based system softwaróİdONLNda)‚5
  7934. e patches .°dONLNdk5äA(>äto be loaded into memory beforR`°dONLNdâ5A;)ä    e the car$¿°dONLNdí5;AÖ)'d is initialized. ˜ °dONLNd§5ÑAã)IY  °dONLNd•5ãAõ)our   °dONLNd©5õA›) PrimaryInit  °dONLNd¥5›A)B
  7935.  code can °dONLNdæAäMŒ(Jädisable the carR`°dONLNdÕAŒM5)Dd temporarily and the R`°dONLNd„A5MÉ)g
  7936. SecondaryInitR`°dONLNdAÉM∞)N  code can r$¿°dONLNd˚A∞M‚)- eenable it. °dONLNd    Sä_ê(\äTï°dONLNd        Sè_)o disable a NuBus carg`°dONLNd    S_0)a
  7937. d temporarilyK†°dONLNd    +S/_å)?, the initialization r°dONLNd    ASå_À)]outine in your °dONLNd    PSÀ_
  7938. )? PrimaryInit°dONLNd    [S
  7939. _)B °dONLNd    \_äké(härR`°dONLNd    ]_ék†)ecor$¿°dONLNd    a_†kÕ)
  7940. d should r˜ °dONLNd    k_Ãk),
  7941. eturn in the ˜ °dONLNd    x_k2)6seStatus˜ °dONLNd    Ä_2k;)0 fi˜ °dONLNd    É_;ki)     eld of the ˜ °dONLNd    é_ikì).SEBlock˜ °dONLNd    ï_ìkπ)*     data str„ °dONLNd    û_πkœ)&ucturµÄ°dONLNd    £_œk)e (described in .°dONLNd    ≥käw=(tä&“Loading Drivers and Executing Code fr∂ °dONLNd    Ÿk=wq)≥
  7942. om sResour≤‡°dONLNd    „kqw†)4 ce Data StrM °dONLNd    Ók°w∏)0uctur”°dONLNd    Ûk∏wˆ)es” on page 3-O@°dONLNd
  7943. k˜w)?53O@°dONLNd
  7944. kw)
  7945. ) an .°dONLNd
  7946. wäÉó(ÄäerrR`°dONLNd
  7947. wóÉ-)
  7948. "or code with a value in the range R`°dONLNd
  7949. -w-É{)ñ
  7950. svTempDisableR`°dONLNd
  7951. :w{É∞)N  ($8000) thr$¿°dONLNd
  7952. Fw∞É»)5ough $¿°dONLNd
  7953. Kwȃ)
  7954. svDisabled$¿°dONLNd
  7955. UwÉ)< °dONLNd
  7956. VÉäèk(åä2($8080). The Slot Manager places this code in the °dONLNd
  7957. àÉkèπ)·
  7958. siInitStatusV°dONLNd
  7959. ïÉπè¬)N fi°dONLNd
  7960. òɬè)    eld of the slot .°dONLNd
  7961. ®èäõ≈(òä
  7962. information rÄ`°dONLNd
  7963. µè≈õ◊);ecorÙ¿°dONLNd
  7964. πè◊õ)Hd that the Slot Manager maintains for the slot, and it places the fatal .°dONLNd õäßó(§äerrR`°dONLNd õóߢ)
  7965. or R`°dONLNd õ¢߈) smInitStatVErrR`°dONLNd õˆß3)T (–355) in the R`°dONLNd $õ3ßu)= initStatusA≈¿°dONLNd /õtß})A fi≈¿°dONLNd 2õ}ß«)    eld of the sInfo rò °dONLNd Dõ«ßŸ)JecorjİdONLNd HõŸß)
  7966. d. The car<‡°dONLNd Rõß)-d .°dONLNd Tßä≥Õ(∞äand its sResour °dONLNd cߌ≥˚)D ce data str˛ °dONLNd nß˙≥),ucturѰdONLNd sß≥&)es arœ†°dONLNd xß&≥
  7967. )3e then unavailable for use by the Operating System.ˇ%»@ˇ ˇˇˇˇ@
  7968. ˇ·ˇ‚7^
  7969. 4*\˜, Palatino
  7970. .+l"CHAPTER €`)\3,     Helvetica
  7971.     (@lThe Slot Manager4⁄*˙¯
  7972. (‡*3 )-c)14
  7973.     )9Using the Slot Manager
  7974. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  7975. °dONLNd\lh˜(elWAfter the Operating System loads RAM patches, the Slot Manager checks the value of the ,
  7976. Courierˇˇg‰.°dONLNdWhlt∫*
  7977. siInitStatusAˇˇÕLÛ`°dONLNddhπtæ)M fë,°dONLNdfhøt$)ield. If this value is grf°dONLNdh$tŸ)e+eater than or equal to 0, indicating no err¢»°dONLNd™hŸt‚)µorÂh°dONLNd¨h·t˜), the °dONLNd≤tlĉ(}lSlot Manager executes the °dONLNdÃt‰Ä2)x
  7978. SecondaryInit°dONLNdŸt2Ä¢)N code. If the value in the °dONLNdÙt¢Ä)p
  7979. siInitStatusAÛ`°dONLNdtÔÄÒ)M °dONLNdÄlås(âlfi°dONLNdÄsåé)eld is °dONLNd Äéå‹)
  7980. smInitStatErr¬†°dONLNdÄ€åc)M, the Slot Manager checks the ¬†°dONLNd6Äcå±)à
  7981. siInitStatusV¬†°dONLNdCıå∫)N fi¬†°dONLNdFÄ∫åÍ)     eld. If the °dONLNdRålò•(ïl
  7982. value of the °dONLNd_å•òÛ)9
  7983. siInitStatusV°dONLNdlåÛò¸)N fi°dONLNdoå¸òO)    eld is in the range °dONLNdÉåOòù)S
  7984. svTempDisable°dONLNdêåùòÆ)N thrR`°dONLNdîåÆòΔ)ough °dONLNdôòl§®(°l
  7985. svDisabled°dONLNd£ò®§-)<, the Slot Manager clears the °dONLNd¡ò-§{)Ö
  7986. siInitStatusAÛ`°dONLNdŒòz§Ä)M f√‡°dONLNd–òħ¨)
  7987. ield and r؇°dONLNd⁄ò¨§Œ),uns the °dONLNd‚§l∞∫(≠l
  7988. SecondaryInit°dONLNdÔ§∫∞”)N code.°dONLNdˆ∂l¬µ(ølFor examples of °dONLNd∂µ¬˜)I PrimaryInit°dONLNd∂˜¬ )B and °dONLNd∂ ¬Z)
  7989. SecondaryInit°dONLNd#∂Z¬Ö)N  code, see .°dONLNd.∂Ö¬›)+Designing Cards and °dONLNdB¬lŒÛ(Àl Drivers for the Macintosh FamilyİdONLNdb¬ÛŒı)á.
  7990. Û*˘¯4Ù*˘¯ ÙlÙ¯
  7991. ˇ·ˇ‚7^
  7992. ˇˇ◊ˇ◊°dONLNdd‚lÛG(ÔlDeleting and Restoring sResourÿ‡°dONLNdÇ‚GÛë)€ ce Data StrDê°dONLNdç‚íÛ∑)Kuctur‡°dONLNdí‚∑Û≈)%esˇˇˇˇˇˇ®)93
  7993. °dONLNdï˘lµ(lSome NuBus caræ°dONLNd£˘µ¸)Ids have sResourã@°dONLNd≤˘˝*)H ce data strÅ@°dONLNdΩ˘*A)-uctur °dONLNd¬˘B)(es to support a variety of combinations °dONLNdÍlÆ(lof system confiˆ`°dONLNd˘Æ¿)B=gurations or modes. The Slot Manager loads all of the sResour°dONLNd6¡‚(¡ce data .°dONLNd>lx(lstrl°dONLNdAxé) uctur>`°dONLNdFéh)1es during system initialization, and then the car¿°dONLNdwhw)⁄d’s ¿°dONLNd{wπ) PrimaryInit¿°dONLNdÜπ‚)B
  7994.  code can .°dONLNdêl)ê(&l    delete frº@°dONLNdôê)„)$om the Slot Resour9`°dONLNd´‰)ı)Tce T)°dONLNdØı)?)able any sResourˆ`°dONLNdø?)l)J ce data strÏ`°dONLNd l)É)-ucturr@°dONLNdœÑ)¨)
  7995. es that arî°dONLNdŸ¨)ƒ)(e not °dONLNdfl)l5Ä(2lapprI@°dONLNd„)Å5)opriate for the system as confi´@°dONLNd)5)ÑgurİdONLNd)5¡)'ed. If the user changes the system confiØ °dONLNd-)¡5ı)¨ guration or °dONLNd95lAü(>l
  7996. selects a difR†°dONLNdF5üA´)3fer5 °dONLNdI5´A;)  ent mode of operation, you can rB†°dONLNdi5;A´)êeinstall a deleted sResouràİdONLNdÉ5´AÃ)pce data .°dONLNdãAlMx(Jlstrl°dONLNdéAxMé) uctur>`°dONLNdìAéM¨)e. The >`°dONLNdöA¨M˙)
  7997. SDeleteSRTRec>`°dONLNdßA˙Mg)N function deletes sResour¿°dONLNd¿AgMñ)m ce data str¸¿°dONLNdÀAïM´).ucturœ °dONLNd–A´MÀ)es; the °dONLNdÿMlY¥(Vl InsertSRTRec°dONLNd‰M¥Y‡)H  function rR`°dONLNdÔM‡Y%),einstalls them..°dONLNdˇ_lkR(hl3Because none of the Slot Manager functions can sear6İdONLNd2_Skí)Ách for sResourg`°dONLNd@_íkø)? ce data str]`°dONLNdK_øk÷)-uctur„@°dONLNdP_÷kı)es that °dONLNdXklw≈(tlhave been deleted frİdONLNdlkΔw)Zom the Slot Resourdž°dONLNd~kw*)Sce Tr@°dONLNdÇk*wê)able, you must keep a r˚†°dONLNdôkêw¢)fecorp°dONLNdùk£wÁ)d of all sResourŸ °dONLNd≠kÁwÚ)Dce °dONLNd∞wlÉç(Äldata strº °dONLNd∏wçɧ)!ucturB°dONLNdΩw•Éó)7es that you have deleted so that you will have the appr7@°dONLNdÙwóÉË)Úopriate parameter °dONLNdÉlè‚(ålvalues when you want to rS °dONLNdÉ‚è)v
  7998. einstall one..°dONLNd-ïl°†(ûl
  7999. When you rR`°dONLNd7ı)4einstall an sResour$¿°dONLNdJïı°$)U ce data str¿°dONLNdUï$°:)/uctur„ °dONLNdZï9°Ø)e, you can also update the „ °dONLNduïØ°Ò)v dCtlDevBase„ °dONLNdÄïÒ°Û)B °dONLNdŰl≠s(™lfi°dONLNdɰs≠≤)eld in the corrR`°dONLNdí°≤≠)?esponding device driver¿°dONLNd©°≠^)m’s device contr‚ °dONLNd∏°]≠Ä)>ol entryΔ`°dONLNd¿°≠ò)". The Δ`°dONLNdΔ°ò≠⁄) dCtlDevBaseΔ`°dONLNd—°⁄≠„)B fiΔ`°dONLNd‘°„≠Ù)    eld .°dONLNdÿ≠lπ¨(∂lholds the addr·‡°dONLNdÊ≠¨π˙)@ess of the sResourİdONLNd¯≠˚π()O ce data struİdONLNd≠(π?)-uctur˚`°dONLNd≠?π◊)$e that is used by that device driver††°dONLNd,≠◊πÙ)ò. For a .°dONLNd4πl≈•(¬l video driver¬†°dONLNd@π§≈ˆ)8, for example, the ¬†°dONLNdSπˆ≈8)R dCtlDevBase¬†°dONLNd^π8≈A)B fi¬†°dONLNdaπA≈ª)    eld might contain the addrï°dONLNd{πª≈Á)z ess of the ˇˇ√N°dONLNdÜ≈l—ñ(Œl    frame bufưdONLNdè≈ó—§)+ferXN°dONLNdí≈£—Ã)
  8000. . Use the ˇˇIÍ¢8°dONLNdú≈×)) InsertSRTRecˇˇ√N¢8°dONLNd®≈—T)H to update the ˇˇIÍØp°dONLNd∑≈T—ñ)@ dCtlDevBaseˇˇ√NØp°dONLNd¬≈ñ—û)B firæ°dONLNd≈≈ü—¯)    eld. See the Device .°dONLNdŸ—l›#(⁄l(Manager chapter of this volume for a defi-‡°dONLNd—$›í)∏nition of the device contrl`°dONLNd—훥)nol entry熰dONLNd$—≥›µ)!.
  8001. *¯4*¯ l¯
  8002. ˇ·ˇ‚7^
  8003. ˇˇ◊ˇ◊°dONLNd&ÒlJ(˛lEnabling and Disabling sResourΔ‡°dONLNdDÒJî)fi ce Data Str2ê°dONLNdOÒï∫)Kuctur ‡°dONLNdTÒ∫»)%esˇˇˇˇˇˇ®)63
  8004. °dONLNdWl∂(lUnder certain cir6‡°dONLNdh∑ñ)K0cumstances, you might want to disable an sResourV‡°dONLNdòñ√)fl ce data strL‡°dONLNd£√⁄)-uctur“¿°dONLNd®⁄·)e °dONLNd™l ì(l
  8005. while it r2İdONLNd¥î )( emains listed in the Slot ResourÈ¿°dONLNd‘ /)äce TŸ`°dONLNdÿ/ ∏)able. For example, a NuBus carÔ¿°dONLNdˆ∏ ›)âd might °dONLNd˛ l,u()lprG °dONLNd     v,·)
  8006. Sovide several modes of operation, only one of which can be active at a given time. °dONLNd    S,l8r(5lY@İdONLNd    T,r8N)1our application might want to disable the sResourÛ‡°dONLNd    Ö,N8{)‹ ce data strȇ°dONLNd    ê,{8í)-ucturo¿°dONLNd    ï,ì8Ú)es associated with all °dONLNd    ¨8lDÓ(Al[but the active mode, but still list all available modes in a menu. When the user selects a °dONLNd
  8007. DlPW* 4new mode, your application can then disable the currM†°dONLNd
  8008. ;DXP∞)Ïently active sResour‡†°dONLNd
  8009. OD∞P—)Xce data °dONLNd
  8010. WPl\w(Ylstrfi°dONLNd
  8011. ZPw\é) ucturc‡°dONLNd
  8012. _Pè\7)'e and enable the one the user selected..°dONLNd
  8013. áblns(klYï°dONLNd
  8014. àbrn†) ou use the ï°dONLNd
  8015. ìb†nÓ).
  8016. SetSRsrcStateï°dONLNd
  8017. †bÓnü)N) function to enable or disable an sResourg`°dONLNd
  8018. …bünŒ)± ce data strS`°dONLNd
  8019. ‘bŒn‰)/uctur%¿°dONLNd
  8020. Ÿb‰nÓ)e. .°dONLNd
  8021. ‹nlzö(wl Listing 3-1 @°dONLNd
  8022. Ánõz˜)/ disables the sResourh†°dONLNd
  8023. ¸n˜z$)\ ce data str^†°dONLNd n$z;)-uctur‰Ä°dONLNd n;zq)
  8024. e in slot $0Aˇ¿°dONLNd nqzª)6 with an sResour◊İdONLNd )nªzÒ)J
  8025. ce ID of 128 °dONLNd 6zlÜ÷(Éland enables the sResour`°dONLNd Mz◊Ü)k ce data str`°dONLNd XzÜ)-ucturã@°dONLNd ]zÜ∏)%e in the same slot with an ID of 131.ˇ@ˇ ˇˇˇˇ@
  8026. ˇ·ˇ‚7^
  8027. 4H\, Palatino
  8028. .+ä"CHAPTER €`)\3,     Helvetica
  8029.     (@äThe Slot Manager4⁄ä˙(‡äUsing the Slot Manager
  8030. ~¿(‡3
  8031. ‡)-a¿)15
  8032. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿
  8033. gHj4gHj"gHa
  8034. ˇ·ˇ‚7^
  8035.     °dONLNdˇˇ(dä Listing 3-1°dONLNd\Œgï)D0Disabling and Enabling sResource data structures,
  8036. Courier
  8037. .°dONLNd1säú(|äVAR°dONLNd9Åúç+mySpBlk: SpBlock;°dONLNdOèúõ¿*myErr:°dONLNdXè“õˆ)6OSErr;°dONLNd`´ä∑®(¥äBEGIN°dONLNdjπú≈í+){Set required values in parameter block.}°dONLNdò«ú”¸*WITH mySpBlk DO °dONLNd≠’ú·∫*BEGIN°dONLNd∏„ÆÔ+spParamData := 1;°dONLNd–„,Ôb)~    {disable}°dONLNdflÒÆ˝(˙ÆspSlot := $0A;°dONLNdÙÒ,˝z)~
  8038. {slot number}°dONLNdˇÆ ˆ(Æ spID := 128;°dONLNdˇ, Ä)~{sResource ID}°dONLNd.
  8039. Æ(ÆspExtDev := 0;°dONLNdC
  8040. ,∂)~{ID of external device}°dONLNd_ú'¥($úEND;°dONLNdh)ú5b*!myErr := SetSRsrcState(@mySpBlk);°dONLNdé7úCÄ*&IF myErr <> noErr THEN DoError(myErr);°dONLNd∫Sú_¸*WITH mySpBlk DO °dONLNdœaúm∫*BEGIN°dONLNd⁄oÆ{+spParamData := 0;°dONLNdÚo,{\)~{enable}°dONLNd}Æâ(ÜÆspSlot := $0A;°dONLNd},âz)~
  8041. {slot number}°dONLNd(ãÆóˆ(îÆ spID := 131;°dONLNd;ã,óÄ)~{sResource ID}°dONLNdOôÆ•(¢ÆspExtDev := 0;°dONLNddô,•∂)~{ID of external device}°dONLNdÄßú≥¥(∞úEND;°dONLNdâµú¡b*!myErr := SetSRsrcState(@mySpBlk);°dONLNdØ√úœÄ*&IF myErr <> noErr THEN DoError(myErr);°dONLNd÷—䛢(⁄äEND;
  8042. H 4H
  8043.  ä
  8044. ˇ·ˇ‚7^
  8045. ˇˇ◊.ˇ◊°dONLNd€Ûäß*&Searı@°dONLNdflÛß )ching for sResour<P°dONLNdÛ!k)z ce Data Str®°dONLNd˚Ûkê)JucturÇP°dONLNdÛêû)%esˇˇˇˇˇˇ®)~3
  8046. °dONLNd
  8047. ä‰(äThe Slot Manager prÙ‡°dONLNd
  8048. ‰))Zovides several r1‡°dONLNd&
  8049. *r)Foutines that sear”°dONLNd7
  8050. r±)Hch for sResour‡°dONLNdE
  8051. ≤fl)@ ce data str˘‡°dONLNdP
  8052. fiı),uctur¿°dONLNdU
  8053. ˆ )es in °dONLNd[ä"Ã(äthe Slot Resour3†°dONLNdjÕ"fi)Cce T#@°dONLNdnfi")
  8054. able. These rd@°dONLNd{"Ò)72outines all allow you to specify for which sResourõ@°dONLNd≠Ò")‹ce data °dONLNdµ"ä.ï(+ästrfi°dONLNd∏"ï.¨) ucturc‡°dONLNdΩ"≠.’)
  8055. es to searÓ°dONLNd«"’.+)(ch, but they each prø†°dONLNd€",.w)Wovide slightly dif˚†°dONLNdÌ"w.É)Kferfi °dONLNd"É.∑) ent options..°dONLNd˝4ä@û(=äThe °dONLNd4û@Ï)
  8056. SFindSRsrcPtr°dONLNd4Ï@)N and °dONLNd4@I) SGetSRsrcPtr°dONLNd4I@)H
  8057.  functions arR`°dONLNd,4@ÿ)6e the simplest. The °dONLNd@@äLÿ(Iä
  8058. SFindSRsrcPtr°dONLNdM@ÿL)N  function rR`°dONLNdX@L),equir$¿°dONLNd]@LÂ).es you to specify a slot number and an sResour˜ °dONLNdã@‰L˝)…ce ID .°dONLNdëLäX°(Uäand r≤ °dONLNdñL°X()eturns a pointer to the sResour>¿°dONLNdµL)XV)à ce data str4¿°dONLNd¿LVXm)-uctur∫†°dONLNd≈LmX∑)e with the specifi¢‡°dONLNd◊L∏XÓ)K
  8059. ed ID in the °dONLNd‰Xäd¶(aäspecifiÓ °dONLNdÎX¶d»)    ed slot. .°dONLNdıjävû(säThe °dONLNd˘jûvÊ) SGetSRsrcPtr°dONLNdjÊv¯)H? function allows you to specify that you want the function to rR`°dONLNdDj¯v(s¯eturn .°dONLNdJväÇ(äa pointer to the next sResour˛Ä°dONLNdgvÇ5)~ ce data strÙİdONLNdrv5ÇL)-ucturz`°dONLNdwvMÇ˙)(e—that is, the one with the next higher ˇˇ˚ä.°dONLNdüÇäé¨(ãäsResourR`°dONLNd¶Ǩé¯)"ce ID. When sear^°dONLNd∂Ǣék)Mching for the next sResour◊ʰdONLNd–Çkéô)r ce data str∫˙°dONLNd€Çöé∞)/ucturçZ°dONLNd‡Ç∞éÀ)e, the ˇˇÚûÑn°dONLNdÁÇÃé) SGetSRsrcPtrˇˇ˚äÑn°dONLNdÛÇé)H .°dONLNdÙéäö(óä function also allows you to sear†°dONLNdéöÃ)å(ch for both enabled and disabled sResour»`°dONLNd<éÃöÌ)∂ce data °dONLNdDöä¶ï(£ästrfi°dONLNdGöﶨ) ucturc‡°dONLNdLö≠¶)es, or enabled ones only3 °dONLNddö¶)i.ˇ @ˇ ˇˇˇˇ@
  8060. ˇ·ˇ‚7^
  8061. 4*\˜, Palatino
  8062. .+l"CHAPTER €`)\3,     Helvetica
  8063.     (@lThe Slot Manager4⁄*˙¯
  8064. (‡*3 )-c)16
  8065.     )9Using the Slot Manager
  8066. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  8067. .°dONLNd\lhÄ(elThe ,
  8068. Courier°dONLNd\Ähº)
  8069. SNextSRsrc°dONLNd\ºh—)< and °dONLNd\—h)    SGetSRsrc°dONLNd\h=)6
  8070.  functions arR`°dONLNd)\=hf)6    e similarï°dONLNd2\eh≥)(, although they rg`°dONLNdC\≥h›)N    eturn mor9¿°dONLNdL\›h‰)*e .°dONLNdNhltÚ(qlinformation about the sResour†°dONLNdkhÛt )á ce data str†°dONLNdvh t7)-ucturéİdONLNd{h7ty)e, such as the fiÖ°dONLNdåhztπ)Celds of its sRsr-‡°dONLNdúh∫tƒ)@cTÿ‡°dONLNdûh√tÌ)        ype entry˜ °dONLNdßhÏtÒ)). .°dONLNd™zlÜÄ(ÉlThe °dONLNdÆzÄÜ‘)SNextTypeSRsrc°dONLNdºz‘ÜÈ)T and °dONLNd¡zÈÜ7)
  8071. SGetTypeSRsrc°dONLNdŒz7Ü®)N functions allow even morR`°dONLNdÁz®Ü≈)qe contr$¿°dONLNdÓz≈Üfi)ol. Wò °dONLNdÛz›ÜÓ)ith .°dONLNd˜ÜlíÍ(èlthese functions, you can searH@°dONLNdÜÎíP)ch for the next sResour\İdONLNd+ÜPí})e ce data strRİdONLNd6Ü}íî)-ucturÿ`°dONLNd;ÜîíÁ)e with a particular °dONLNdOílûè(õlsResour≥@°dONLNdVíèû∞)#ce type.°dONLNd_§l∞r(≠lTµ¿°dONLNd`§q∞-))able 1-1 summarizes the Slot Manager sear,°dONLNdâ§.∞>)Ωch r≤†°dONLNdç§>∞·)&outines and the options available for °dONLNd≥∞lºÇ(πleach.
  8072. fl*Á¯4‡*Á¯ „*„˛
  8073. ˇ·ˇ‚7^
  8074.     °dONLNdˇˇ*$    Table 3-3°dONLNd𒙇")>Slot Manager search routines °dONLNdÿÌ㯆(ıãState¿°dONLNd›Ì°¯£) ˇ‡°dONLNdfiÌ£¯≠)of °dONLNd„ÌW¯t)¥Which °dONLNdÍÌد¥)XTT°dONLNdÎÌ¥¯√)ype’°dONLNdÓÌ√¯≈) V°dONLNdÔÌΔ¯–)of °dONLNdÙ˜ãæ(ˇã
  8075. sResourcesɰdONLNd˛˜æ¿)3  °dONLNdˇ˜¡»)it °dONLNd˜)/Slots¿°dONLNd˜) ˇ‡°dONLNd    ˜)it °dONLNd
  8076. ˜WÖ)O    sResourceÇ0°dONLNd˜Öá). P°dONLNd˜àè)it °dONLNd˜Ø›)'    sResourceÇ0°dONLNd$˜›fl). P°dONLNd%˜‡Á)it °dONLNd)* O(    *Function°dONLNd2ã ≤)asearchesÑP°dONLNd:≤ ¥)' p°dONLNd;µ ¿)for°dONLNd? );searches°dONLNdHW ~)gsearchesÑP°dONLNdP~ Ä)' p°dONLNdQÅ å)for°dONLNdUØ ÷).searchesÑP°dONLNd]÷ ÿ)' p°dONLNd^Ÿ ‰)for
  8077. .°dONLNdb*x(*
  8078. SFindSRsrcPtr.°dONLNdpã≈)a Enabled only°dONLNd}
  8079. )eSpecifi‡°dONLNdÑ
  8080. ,)ed slot °dONLNdçWt)JSpecifi‡°dONLNdîtÅ)ed °dONLNdòØÿ);Any type°dONLNd£&Ú(# °dONLNd•W&z)gsResour≥@°dONLNd¨z&õ)#ce only .°dONLNdµ,*8f(5*
  8081. SNextSRsrc.°dONLNd¿,ã8≈)a Enabled only°dONLNdÕ,8
  8082. )eSpecifi‡°dONLNd‘,
  8083. 8=) ed slot and°dONLNd‡,W8í)J Next sResour∂¿°dONLNdÏ,í8ù);ce °dONLNd,Ø8ÿ)Any type°dONLNd˚7C%(@
  8084. higher slots °dONLNd    7WCm)gonly .°dONLNdI*Ur(R* SGetSRsrcPtr°dONLNdIrUz)H*,.°dONLNdIãUë)Y@İdONLNdIëU )
  8085. our choice of°dONLNd-IUˆ)_Y@İdONLNd.IˆUA)our choice of one°dONLNd@IWU])aY@İdONLNdAI]Uò)our choice of °dONLNdPIØUÿ)RAny type.°dONLNdYT*``(]*    SGetSRsrc°dONLNdbT``e)6*.°dONLNddTã`–)+enabled only or°dONLNdtT`")e slot only or°dONLNdÅTW`s)gspecifiÓ °dONLNdàTs`Ä)ed °dONLNdç_ãk◊(hãboth enabled and°dONLNdû_k )especifiÓ °dONLNd•_ k<) ed slot and°dONLNd±_Wkz)KsResour≥@°dONLNd∏_zkë)#ce or °dONLNd¿jãv∞(sãdisabled°dONLNd…jv#)e higher slots°dONLNd÷jWvè)g next sResour9@°dONLNd‚jêvô)9ce.°dONLNdÂ|*à~(Ö*SNextTypeSRsrc.°dONLNdÙ|ãà≈)a Enabled only°dONLNd|à
  8086. )eSpecifi‡°dONLNd|
  8087. à=) ed slot and°dONLNd|Wàí)J Next sResour∂¿°dONLNd |íàõ);ce°dONLNd#|ØàÃ)Specifi‡°dONLNd*|ÃàÔ)ed type °dONLNd5áì%(ê
  8088. higher slots °dONLNdCáWìj)gonly°dONLNdHáØì¬)Xonly.°dONLNdMô*•x(¢*
  8089. SGetTypeSRsrc°dONLNdZôx•})N*.°dONLNd\ôã•ë)Y@İdONLNd]ôë• )
  8090. our choice of°dONLNdkô•ˆ)_Y@İdONLNdlôˆ•/)
  8091. our choice of°dONLNdzôW•í)a Next sResour∂¿°dONLNdÜôí•õ);ce°dONLNdâôØ•Ã)Specifi‡°dONLNdêôÕÌ)ed type°dONLNdô§ã∞–(≠ãenabled only or°dONLNd©§∞4)eone slot only or°dONLNd∫§W∞j)gonly°dONLNdø§Ø∞¬)Xonly°dONLNd≈Øãª◊(∏ãboth enabled and°dONLNd÷Øª )especifiÓ °dONLNd›Ø ª<) ed slot and°dONLNdÍ∫ãΔ∞(√ãdisabled°dONLNdÛ∫Δ#)e higher slots
  8092. °dONLNd”l‹q(⁄l* QİdONLNd”q‹w)AŒÄ°dONLNd”v‹Ì)!vailable only with system softwar°dONLNd$”Ó‹K)xe version 7.0 Slot Manager
  8093. °dONLNd?ˆlö(ˇl Listing 3-2 @°dONLNdJˆõÔ)/ shows how to searYİdONLNd\ˆÔ…)T2ch all slots for both enabled and disabled sResour˙@°dONLNd鈅Í)⁄ce data .°dONLNdñlx( lstrl°dONLNdôxé) uctur>`°dONLNdûé·)es with an sResour¿°dONLNd∞·7)Sce type category of ¿°dONLNdƒ7s)V
  8094. catDisplay¿°dONLNdŒs∑)< and an sResour„ °dONLNd›∂ÿ)Cce type °dONLNdÂlÆ(lsubcategory of °dONLNdÙÆfi)BtypVideo°dONLNd¸fi·)0.ˇt@ˇ ˇˇˇˇ@
  8095. ˇ·ˇ‚7^
  8096. 4H\, Palatino
  8097. .+ä"CHAPTER €`)\3,     Helvetica
  8098.     (@äThe Slot Manager4⁄ä˙(‡äUsing the Slot Manager
  8099. ~¿(‡3
  8100. ‡)-a¿)17
  8101. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿
  8102. gHj4gHj"gHa
  8103. ˇ·ˇ‚7^
  8104.     °dONLNdˇˇ(dä Listing 3-2°dONLNd\Œgo)D'Searching for sResource data structures,
  8105. Courier
  8106. .°dONLNd(sHZ(|HVAR°dONLNd.ÅfçÃ+mySpBlk: SpBlock;°dONLNdBèfõä*myErr:°dONLNdKèúõ¿)6OSErr;°dONLNdS´H∑f(¥HBEGIN°dONLNd[πf≈\+){Set required values in parameter block.}°dONLNdá«f”Δ*WITH mySpBlk DO °dONLNdö’f·Ñ*BEGIN°dONLNd£„xÔfi+spParamData := 1;°dONLNdΩ„ÔÚ)¢${fAll flag 1: search all sResources}°dONLNdÓÒ˝Ï*#{fOneSlot flag 0: search all slots}°dONLNdˇx (xspCategory := $catDisplay;°dONLNd8ˇ ⁄)¢ {search for Category catDisplay}°dONLNd\
  8107. x(xspCategory := $typeVideo;°dONLNd~
  8108. ¬)¢{search for cType typeVideo}°dONLNdûx'Ã($xspDrvrSW := 0;°dONLNdµ'Œ)¢{this field not being matched}°dONLNd◊)x5Ã(2xspDrvrHW := 0;°dONLNdÓ)5Œ)¢{this field not being matched}°dONLNd7xCÃ(@xspTBMask := 0;°dONLNd'7C˛)¢&{match only Category and cType fields}°dONLNdQExQ¿(Nx spSlot := 0;°dONLNdfEQ™)¢{start search from here}°dONLNdÇSx_¥(\x
  8109. spID := 0;°dONLNdïS_™)¢{start search from here}°dONLNd±axmÃ(jxspExtDev := 0;°dONLNd»amº)¢{ID of the external device}°dONLNdÊof{~(xfEND;°dONLNdÌ}fâ®* myErr := 0;°dONLNd¸ôf•Í*WHILE myErr = noErr DO°dONLNdô•º)¥{loop to search sResources}°dONLNd:ßf≥Ñ(∞fBEGIN°dONLNdCµx¡>+!myErr := SGetTypeSRsrc(@mySpBlk);°dONLNdh√xœ*MySRsrcProcessor(mySpBlk);°dONLNdã√œ‡)¢!{your routine to process results}°dONLNdØ—f›~(⁄fEND;°dONLNd∂flfÎÄ*/IF myErr <> smNoMoresRsrcs THEN DoError(myErr);°dONLNdÊÌH˘`(ˆHEND;
  8110. 7H=47H< 7ä7
  8111. ˇ·ˇ‚7^
  8112. ˇˇ◊.ˇ◊°dONLNdÎ%ä6$+B<Getting Information fr®`°dONLNd%$6u)ö
  8113. om sResour@°dONLNd %v6¿)R ce Data Str´∞°dONLNd%¿6Â)JucturܰdONLNd%Â6Û)%esˇˇˇˇˇˇ®))3
  8114. °dONLNd<äHØ(Eä    If you ar °dONLNd'<∞H#)&e writing a driver for a car‘İdONLNdC<#H˘)s2d device, you will most likely want access to the °dONLNduHäT˝(Qäinformation in an sResoury¿°dONLNdéH˝T*)s ce data stro¿°dONLNdôH*TA)-ucturı†°dONLNdûHATJ)e. °dONLNd¢Zäf‰(cäThe Slot Manager prÙ‡°dONLNdµZ‰fb)Zovides many functions that r∂@°dONLNd—Zcfª)eturn information fra†°dONLNdÂZºf)Yom the entries of an .°dONLNd˙fär¨(oäsResourR`°dONLNdf¨r€)" ce data str>`°dONLNd f€rÒ)/uctur¿°dONLNdfÒr)e. The ¿°dONLNdfrQ) SOffsetData¿°dONLNd#fQrV)B, ¿°dONLNd%fVrå)    SReadByte¿°dONLNd.får§)6, and ¿°dONLNd4f§r⁄)    SReadWord¿°dONLNd=f⁄r)6  functions °dONLNdHrä~é({ärR`°dONLNdIré~Á)eturn information fr$¿°dONLNd]rÁ~)Y    om the of˜ °dONLNdfr~*))fset fi˜ °dONLNdmr*~u)eld of an sResour…İdONLNd~ru~™)K
  8115. ce list entry≠¿°dONLNdãr©~¬)4. The ≠¿°dONLNdër¬~¯)    SReadLong≠¿°dONLNdör¯~˝)6, °dONLNdú~ääÃ(áä SGetCString°dONLNdß~Ãä‰)B, and °dONLNd≠~‰ä)    SGetBlock°dONLNd∂~äJ)6  functions rR`°dONLNd¬~Jä¡)0eturn copies of the standar$¿°dONLNd›~¡äÌ)w
  8116. d data str¿°dONLNdÁ~Ìä),uctur„ °dONLNdÏ~ä
  8117. )es °dONLNdÔääñ‚(ìäpointed to by the ofR`°dONLNdä‚ñ¸)Xfset fiR`°dONLNd
  8118. ä¸ñG)eld of an sResour$¿°dONLNdäGñ|)K
  8119. ce list entry    °dONLNd(ä{ñî)4. The     °dONLNd.äîñ÷) SFindStruct    °dONLNd9ä÷ñÎ)B and °dONLNd>ñä¢Ã(üä SReadStruct°dONLNdIñâ|)B) functions allow access to other data strl°dONLNdrñ|¢í)∞uctur>`°dONLNdwñí¢¸)es pointed to by sResour¿°dONLNdèñ¸¢)jce .°dONLNdí¢äÆ∫(´ä
  8120. list entries.ˇfi@ˇ ˇˇˇˇ@
  8121. ˇ·ˇ‚7^
  8122. 4*\˜, Palatino
  8123. .+l"CHAPTER €`)\3,     Helvetica
  8124.     (@lThe Slot Manager4⁄*˙¯
  8125. (‡*3 )-c)18
  8126.     )9Reference to the Slot Manager
  8127. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯
  8128. °dONLNd\lhö(el Listing 3-3 @°dONLNd \õh)/ shows an example of rí@°dONLNd!\h_)eeading information frî¿°dONLNd6\_h†)_
  8129. om an sResour‚‡°dONLNdC\†hÎ)Ace. This example °dONLNdThltÏ(qlexamines the name of the carذdONLNdphÏt&)Äd in slot $0A.
  8130. ñ*ö¯4ó*ô¯"ó*a
  8131. ˇ·ˇ‚7^
  8132.     °dONLNdˇˇ(îl Listing 3-3°dONLNdå∞óQ)D'Searching for sResource data structures,
  8133. Courier
  8134. .°dONLNdߣlØ~(¨lVAR°dONLNdر~Ω‰+mySpBlk: SpBlock;°dONLNd≈ø~À¢*myErr:°dONLNdŒø¥Àÿ)6OSErr;°dONLNd÷€lÁä(‰lBEGIN°dONLNd‡È~ı⁄+:{First get a pointer to the Board sResource for slot $0A.}°dONLNd˜~fi*WITH mySpBlk DO °dONLNd4~ú*BEGIN°dONLNd?ê‰+spSlot := $0A;°dONLNdU û)ê{search in this slot}°dONLNdp!ê-Ã(*ê
  8135. spID := 1;°dONLNdÇ! -Ê)ê!{assume Board sResource has ID 1}°dONLNd®/~;ñ(8~END;°dONLNd±=~ID*!myErr := SFindSRsrcPtr(@mySpBlk);°dONLNd◊K~Wb*&IF myErr <> noErr THEN DoError(myErr);°dONLNdg~s‡*;{The spsPointer field of mySpBlock now contains a pointer }°dONLNdCu~Å‘*9{ to the Board sResource list. The SGetCString function }°dONLNdÅÉ~èí*.{ uses this field as one of two input fields.}°dONLNd¥ë~ùÍ*mySpBlk.spID := 2;°dONLNdœë ùÜ)¢{sRsrcName entry}°dONLNdÊ≠~π8(∂~myErr := SGetCString(@mySpBlk);°dONLNd
  8136. ª~«b*&IF myErr <> noErr THEN DoError(myErr);°dONLNd6◊~„Œ*8{The spResult field now points to a copy of the cString}°dONLNdsÂ~ÒV*$MyProcessCardName(mySpBlk.spResult);°dONLNdòÛlˇÑ(¸lEND;
  8137. 
  8138. *(¯4
  8139. *'¯
  8140. 9*A¯49*@¯ 9*9˛
  8141. ˇ·ˇ‚7^
  8142. ˇˇ£‰.ˇÆ°dONLNdù%*7(3*Reference to the Slot Managerˇˇˇˇˇˇ⁄|(3Ó3
  8143. °dONLNdªHlT‚(QlThis section describes the r@°dONLNd◊H„T‰)w9outines you use to get information about the Slot Manager °dONLNdH‰TÈ(Q‰, °dONLNdTl`©(]l
  8144. expansion carg@°dONLNdT©`Ô)=ds, and sResour``°dONLNd.TÔ`)F ce data strV`°dONLNd9T`3)-uctur‹@°dONLNd>T3`y)es. Most of the r8¿°dONLNdOTz`‚)Goutines in this section fi†@°dONLNdiT‚`)hnd °dONLNdl`llú(il
  8145. an sResour†°dONLNdv`ùl )1 ce data str˙†°dONLNdÅ`…l‡),ucturÄİdONLNdÜ`·là)&e given some information about it or r,‡°dONLNd¨`âlŸ)®ead information frÊİdONLNdæ`Ÿl˜)Pom an °dONLNdƒllx¡(ulentry in an sResourİdONLNd◊l¬x)Vce list. Some of the rf °dONLNdÌlxz)Xoutines allow you to r `°dONLNdl{xÊ)aead and set information °dONLNdxlу(Ålabout expansion car-‡°dONLNd.x≈ÑÂ)Y@ds, such as their parameter RAM values, and others allow you to °dONLNdnÑlêˇ(çl manipulate Slot Manager data str9İdONLNdéÑê)îucturø`°dONLNdìÑêz)es, like the Slot Resour# °dONLNd´Ñ{êå)dce T¿°dONLNdØÑåê†)able.ˇ@ˇ ˇˇˇˇ@
  8146. ˇ·ˇ‚7^
  8147. 4H\, Palatino
  8148. .+ä"CHAPTER €`)\3,     Helvetica
  8149.     (@äThe Slot Manager4⁄ä˙(‡äReference to the Slot Manager
  8150. ~¿(‡3
  8151. ‡)-a¿)19
  8152. (ÔäDraft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^H¿
  8153. mHu4nHu nHn
  8154. ˇ·ˇ‚7^
  8155. ˇˇ◊ˇ◊°dONLNd\HmÄ(iHData Str¢Ä°dONLNd\Äm•)8uctur|–°dONLNd
  8156. \•m≥)%esˇˇˇˇˇˇ®(i3
  8157. °dONLNdyäÖ(ÇäEvery Slot Manager function r“†°dONLNd-yÖ&)Öequirȇ°dONLNd2y&Ö˘)0es a pointer to a parameter block as a parameterfi‡°dONLNdby˘Ö)”, and .°dONLNdhÖäëé(éärR`°dONLNdiÖéë∏)
  8158. eturns an ,
  8159. CourierR`°dONLNdsÖ∏ë÷)*OSErrR`°dONLNdxÖ÷ë‹) r$¿°dONLNdzÖ‹ë*)esult code. Each r˜ °dONLNdåÖ)ë∫)M"outine uses only a subset of the fi˜ °dONLNdØÖ∫ëÏ)ë elds of the .°dONLNdªëäù(öäparameter block, which is defifl¿°dONLNdŸëù-)Öned in P@°dONLNd‡ë.ù\) Listing 3-4İdONLNdÎë\ùÜ). . See the re‡°dONLNdˆëáù)+"outine descriptions for a list of °dONLNdù䩆(¶äthe fiÍ °dONLNdù†©˝)elds used with each rA¿°dONLNd3ù˛©)^outine.
  8160. ÀHœ4ÃHŒ"ÃHa
  8161. ˇ·ˇ‚7^
  8162.     °dONLNdˇˇ(…ä Listing 3-4°dONLNd;¡ŒÃF)DSlot Manager parameter block
  8163. .°dONLNdXÿä‰,(·äTYPE SpBlockPtr = ^SpBlock;°dONLNdtÊäÚ*SpBlock = PACKED RECORD°dONLNdêÙú“+    spResult:°dONLNdûÙˆ&)ZLongInt;°dONLNd™Ù>t)H     {result}°dONLNd∏úfi( ú spsPointer:°dONLNd»ˆ)ZPtr;°dONLNd–>∂)H {structure pointer}°dONLNdÈúΔ(úspSize:°dONLNdıˆ&)ZLongInt;°dONLNd>∂)H {size of structure}°dONLNdú*Í('ú
  8164. spOffsetData:°dONLNd,ˆ*&)ZLongInt;°dONLNd8>*§)H {offset or data}°dONLNdN,ú8Í(5ú
  8165. spIOFileName:°dONLNd`,ˆ8)ZPtr;°dONLNdh,>8Ê)H {reserved for Slot Manager}°dONLNdâ:úF‰(Cú spsExecPBlk:°dONLNdö:ˆF&)ZLongInt;°dONLNd¶:>F)H$ {pointer to SEBlock data structure}°dONLNdœHúT‰(Qú spParamData:°dONLNd‡HˆT)ZPtr;°dONLNdËH>Tn)H {flags}°dONLNdıVúbΔ(_úspMisc:°dONLNdVˆb&)ZLongInt;°dONLNd
  8166. V>bÊ)H {reserved for Slot Manager}°dONLNd.dúpfi(mú spReserved:°dONLNd>dˆp&)ZLongInt;°dONLNdJd>pÊ)H {reserved for Slot Manager}°dONLNdkrú~Í({ú
  8167. spIOReserved:°dONLNd}rˆ~&)ZINTEGER;°dONLNdâr>~Ê)H {ioReserved field from SRT}°dONLNd™Äúå“(âú    spRefNum:°dONLNd∏Ĉå&)ZINTEGER;°dONLNdƒÄ>å⁄)H {driver reference number}°dONLNd„éúöfi(óú spCategory:°dONLNdÛéˆö&)ZINTEGER;°dONLNdˇé>ö)H# {Category field of sResource type}°dONLNd'úú®Ã(•úspCType:°dONLNd4úˆ®&)ZINTEGER;°dONLNd@ú>®˛)H  {cType field of sResource type}°dONLNde™ú∂“(≥ú    spDrvrSW:°dONLNds™ˆ∂&)ZINTEGER;°dONLNd™>∂)H! {DrvrSW field of sResource type}°dONLNd•∏úƒ“(¡ú    spDrvrHW:°dONLNd≥∏ˆƒ&)ZINTEGER;°dONLNdø∏>ƒ)H! {DrvrHW field of sResource type}°dONLNdÂΔú““(œú    spTBMask:°dONLNdÛΔˆ“8)Z SignedByte;°dONLNdΔ>“⁄)H {sResource type bit mask}°dONLNd!‘ú‡Δ(›úspSlot:°dONLNd-‘ˆ‡8)Z SignedByte;°dONLNd<‘>‡í)H {slot number}°dONLNdO‚úÓ∫(ÎúspID:°dONLNdY‚ˆÓ8)Z SignedByte;°dONLNdh‚>Óò)H {sResource ID}°dONLNd|ú¸“(˘ú    spExtDev:°dONLNdäˆ¸8)Z SignedByte;°dONLNdô>¸º)H {external device ID}°dONLNd≥˛ú
  8168. Ã(úspHwDev:°dONLNd¿˛ˆ
  8169. 8)Z SignedByte;°dONLNdœ˛>
  8170. º)H {hardware device ID}°dONLNdÈ ú‰(ú spByteLanes:°dONLNd˙ ˆ8)Z SignedByte;°dONLNd     >∞)H {valid byte lanes}°dONLNd!ú&Ã(#úspFlags:°dONLNd.ˆ&8)Z SignedByte;°dONLNd=>&Ï)H {flags used by Slot Manager}°dONLNd_(ú4¿(1úspKey:°dONLNdj(ˆ48)Z SignedByte;°dONLNdy(>4Ê)H {reserved for Slot Manager}°dONLNdñ6äB¢(?äEND;
  8171. RHa4RHa
  8172.     .°dONLNdˇˇ*Field descriptions
  8173. ˇ·ˇ‚7^
  8174. .°dONLNdõ_äk∫*spResult.°dONLNd§_ÊkÌ)\A∫†°dONLNd•_Ìk@) general-purpose fid °dONLNd∏_Ak´)Teld used to contain the rˇ°dONLNd—_´k )jesults r£`°dONLNdŸ_Àk˝)  eturned by °dONLNd‰kÊw(tÊ several dif{‡°dONLNdÔkw ).fer^`°dONLNdÚk w4) ent rÄ¿°dONLNd˜k4wV)outines..°dONLNdzäÜΔ(Éä
  8175. spsPointer.°dONLNd zÊÜÌ)\A∫†°dONLNd zÌÜF) pointer to a data strfi†°dONLNd"zFÜ])YucturdİdONLNd'z^ÜÅ)e. The fiv†°dONLNd0zÅܯ)#eld can point to an sResour6@°dONLNdKz˘Ü)xce °dONLNdNÜÊí(èÊdata strº °dONLNdVÜí)!ucturB°dONLNd[Üí)4e, a data block, or a declaration ROM, depending on °dONLNdèíÊû˙(õÊthe r¢`°dONLNdîí˙û])outine being executed..°dONLNd´°ä≠Æ(™äspSize.°dONLNd≤°Ê≠X)\The size of the data block.ˇê@ˇ ˇˇˇˇ@
  8176. ˇ·ˇ‚7^
  8177. 4*\˜, Palatino
  8178. .+l"CHAPTER €`)\3,     Helvetica
  8179.     (@lThe Slot Manager4⁄*˙¯
  8180. (‡*3 )-c)20
  8181.     )9Reference to the Slot Manager
  8182. *Draft. PreliminaryVP):, Confi)dential. ©1991 ˘Å)0Apple ComputerÒ)7, Inc. Ìë)1/10/924^*¿¯,
  8183. Courier
  8184. .°dONLNd\lh¥(el spOffsetData.°dONLNd
  8185. \»h')\The contents of the ofí °dONLNd#\'h?)_fset fiª¿°dONLNd*\?hã)eld of an sResour◊İdONLNd;\ãh∏)L ce data strÕİdONLNdF\∏hœ)-ucturS`°dONLNdK\–hÓ)e entry‡`°dONLNdR\ÌhÚ). °dONLNdTh»tÊ(q»Some r‡°dONLNdZhÁt4)outines use this fij‡°dONLNdmh4tv)Meld for other ofU‡°dONLNd}hvtÆ)Bfsets or data..°dONLNdåwlÉ¥(Äl spIOFileName.°dONLNdôw»Ém)\$Reserved for use by the Slot ManagerÔ°dONLNdΩwlÉn)§..°dONLNdøÜlíÆ(èl spsExecPBlk°dONLNdÀÜ»í)\Pointer to an °dONLNdŸÜí-);SEBlock°dONLNd‡Ü-íS)*     data strl°dONLNdÈÜSíi)&uctur>`°dONLNdÓÜiíÅ)e (an >`°dONLNdÙÜÅíü)SExec>`°dONLNd˘ÜüíÚ) parameter block).°dONLNd ïl°Æ(ûl spParamData.°dONLNdï»°/)\On input, this long wor;†°dONLNd/ï0°f)h d contains flT`°dONLNd<ïf°”)6ags that determine what ˇˇkZ.°dONLNdT°»≠Í(™»sResourR`°dONLNd[°Í≠)" ce data str°dONLNdf°≠.).ucturÁt°dONLNdk°-≠ô)es the Slot Manager searg<°dONLNdɰö≠fi)mches. Bit 0 (the ˇ˛B§°dONLNdî°fl≠˜)EfAllˇˇkZ§°dONLNdò°˜≠¯) .°dONLNdô≠»πŒ(∂»flå¿°dONLNdõ≠Œπë),ag) indicates when set that disabled sResour °dONLNd«≠íπø)ƒ ce data str     °dONLNd“≠øπ÷)-ucturè°dONLNd◊≠÷π·)es .°dONLNd⁄π»≈}(¬»)should be included. When set, bit 1 (the °dONLNdπ}≈≠)µfOneslot°dONLNd π≠≈∂)0 fl°dONLNdπ∂≈À)    ag) rR`°dONLNdπÀ≈Ó)    estricts .°dONLNd≈»—Í(Œ»the sear©°dONLNd$≈Í—%)"
  8186. ch to sResour’¿°dONLNd1≈%—R); ce data strÀ¿°dONLNd<≈R—i)-ucturQ†°dONLNdA≈j—¥)es on a single car @°dONLNdS≈µ—Í)Kd. Bit 2 (the .°dONLNda—»›Ê(⁄»fNext°dONLNdf—Ê›Ï) fPİdONLNdh—Ï›Ñ)"lag) indicates when set that the r"‡°dONLNdä—Ñ›¶)òoutine fÛ`°dONLNdí—•››)!
  8187. ind the next .°dONLNdü›»ÈÎ(Ê»sResour≥@°dONLNd¶›ÎÈ)# ce data str©@°dONLNd±›È/)-uctur/ °dONLNd∂›0ÈP)e. The r˘Ä°dONLNdæ›PÈÄ)  est of the fiv°dONLNdÀ›ÅÈ–)1elds must be clearì¿°dONLNd››–È)Oed to 0.°dONLNdÁÏ»¯(ı»On output, this fi}¿°dONLNd˘Ï¯©)L!eld indicates whether the sResourï@°dONLNdÏ©¯÷)ï ce data strã@°dONLNd%Ï÷¯Ì)-uctur °dONLNd*ÏÓ¯ı)e °dONLNd,¯»t(»)is enabled or disabled (if 0, the sResour5 °dONLNdU¯u¢)≠ ce data str+ °dONLNd`¯¢π)-uctur±°dONLNde¯πÒ)e is enabled; °dONLNds»(
  8188. »if 1, it is disabled)..°dONLNdälê(lspMisc.°dONLNdë»m)\$Reserved for use by the Slot ManagerÔ°dONLNdµln)§..°dONLNd∑"l.®(+l
  8189. spReserved.°dONLNd¬"».)\Reserved for futur¢°dONLNd‘".1)Qe use..°dONLNd€1l=¥(:l spIOReserved°dONLNdË1»=)\The value of the °dONLNd˘1=Q)M
  8190. ioReserved°dONLNd1Q=Z)< fi°dONLNd1Z=s)    eld frR`°dONLNd 1s=∂)om the sResour$¿°dONLNd1∂=Ÿ)Cce data .°dONLNd"=»I”(F»strfi°dONLNd%=”IÍ) ucturc‡°dONLNd*=ÎIa)e’s entry in the Slot Resour~@°dONLNdF=aIr)vce Tm‡°dONLNdJ=rIÜ)able..°dONLNdPLlXú(UlspRefNum.°dONLNdYL»X˝)\ The driver rZ°dONLNdeL˝X
  8191. )5efer °dONLNdiLX◊)-ence number of the driver associated with an °dONLNdñX»dÎ(a»sResour≥@°dONLNdùXÎd)# ce data str©@°dONLNd®Xd/)-uctur/ °dONLNd≠X0dT)
  8192. e, if therW`°dONLNd∑XTdw)$    e is one..°dONLNd¡gls®(pl
  8193. spCategory.°dONLNdÃg»s )\The Category fiÒ‡°dONLNd€g s[)Deld of the sResour†°dONLNdÌg\s})Pce type..°dONLNdˆvlÇñ(lspCType.°dONLNd˛v»ÇÂ)\The cTf¿°dONLNdvÂÇ˝)ype fiN`°dONLNd
  8194. v˛ÇM)eld of the sResourv °dONLNdvMÇn)Oce type..°dONLNd%Ölëú(élspDrvrSW.°dONLNd.Ö»ëA)\The DrvrSW of the sResourû@°dONLNdGÖAëb)yce type..°dONLNdPîl†ú(ùlspDrvrHW.°dONLNdYD)\The DrvrHW of the sResour؇°dONLNdrîD†e)|ce type..°dONLNd{£lØú(¨lspTBMask.°dONLNdÑ£»Øœ)\A∫†°dONLNdÖ£œØd)  mask that determines which sRsrˆ°dONLNd•£dØn)ïcT솰dONLNdߣnØÜ)
  8195. ype fi{@°dONLNd≠£áØÈ)elds the Slot Manager °dONLNd√Ø»ª!(∏»examines when seardONLNd’Ø!ªn)Yching for sResour`°dONLNdÊØoªú)N ce data str`°dONLNdÒØúª≥)-ucturã@°dONLNdˆØ≥ªæ)es..°dONLNd˙æl ê(«lspSlot.°dONLNdæ» Ñ)\)The number of the slot with the NuBus carÀ¿°dONLNd*æÑ Œ)ºd containing the °dONLNd; »÷À(”»rE°dONLNd< Ã÷)equested, or rä`°dONLNdJ ÷S)<eturned, sResourz °dONLNdZ S÷Ä)K ce data strp °dONLNde Ä÷ó)-ucturˆ°dONLNdj ó÷û)e..°dONLNdmŸlÂÑ(‚lspID.°dONLNdrŸ»²)\ The sResourÔ°dONLNd}Ÿ˛Â6)6ce ID of the r∞`°d